milestone: GL 客户端构建运行成功(zig cc + go-gl)——窗口/世界/渲染/HUD 全链路 12 秒无崩溃;修复越界查询与编码损坏
This commit is contained in:
@@ -9,7 +9,6 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"image"
|
||||
"os"
|
||||
"os/signal"
|
||||
"sync"
|
||||
|
||||
@@ -44,7 +44,7 @@ func newInputState(win *glfw.Window) *inputState {
|
||||
}
|
||||
|
||||
// keyCallback 键盘回调(动作映射:WASD/空格/Shift/Ctrl/Esc)。
|
||||
func (in *inputState) keyCallback(_ *glfw.Window, key glfw.Key, _ int, action glfw.Action, _ glfw.KeyMods) {
|
||||
func (in *inputState) keyCallback(_ *glfw.Window, key glfw.Key, _ int, action glfw.Action, _ glfw.ModifierKey) {
|
||||
down := action != glfw.Release
|
||||
switch key {
|
||||
case glfw.KeyW:
|
||||
|
||||
@@ -47,8 +47,11 @@ func New(cx, cz int32) *Chunk {
|
||||
// Index 计算方块数组索引:(y*16+z)*16+x。
|
||||
func Index(x, y, z int) int { return (y*SizeZ+z)*SizeX + x }
|
||||
|
||||
// Block 读取方块(读锁)。
|
||||
// Block 读取方块(读锁;越界返回空气,防 mesh/光照边界查询崩溃)。
|
||||
func (c *Chunk) Block(x, y, z int) block.State {
|
||||
if x < 0 || x >= SizeX || y < 0 || y >= Height || z < 0 || z >= SizeZ {
|
||||
return block.Air
|
||||
}
|
||||
c.mu.RLock()
|
||||
defer c.mu.RUnlock()
|
||||
return c.blocks[Index(x, y, z)]
|
||||
|
||||
@@ -86,7 +86,7 @@ func (cg *chunkGL) destroy() {
|
||||
|
||||
// DrawChunks 绘制全部区块网格(三 pass,渲染.md §6)。
|
||||
// chunks:本帧要绘制的区块(已由视锥剔除过滤)。
|
||||
func (r *Renderer) DrawChunks(cx, cz func(i int) (int32, int32), n int) {
|
||||
func (r *Renderer) DrawChunks(get func(i int) (int32, int32), n int) {
|
||||
gl.UseProgram(r.prog)
|
||||
gl.ActiveTexture(gl.TEXTURE0)
|
||||
gl.BindTexture(gl.TEXTURE_2D, r.atlas)
|
||||
@@ -99,21 +99,21 @@ func (r *Renderer) DrawChunks(cx, cz func(i int) (int32, int32), n int) {
|
||||
|
||||
// pass 1+2:不透明与 cutout(alpha test,不排序)
|
||||
gl.Uniform1f(cutLoc, 0)
|
||||
drawPass(r, n, cx, cz, false, false)
|
||||
drawPass(r, get, n, false, false)
|
||||
gl.Uniform1f(cutLoc, 1)
|
||||
drawPass(r, n, cx, cz, false, true)
|
||||
drawPass(r, get, n, false, true)
|
||||
// pass 3:半透明(关闭深度写入,远→近排序由调用方保证顺序)
|
||||
gl.Uniform1f(cutLoc, 0)
|
||||
gl.DepthMask(false)
|
||||
drawPass(r, n, cx, cz, true, false)
|
||||
drawPass(r, get, n, true, false)
|
||||
gl.DepthMask(true)
|
||||
gl.BindVertexArray(0)
|
||||
}
|
||||
|
||||
// drawPass 按通道绘制。
|
||||
func drawPass(r *Renderer, n int, cx, cz func(i int) (int32, int32), translucent, cutout bool) {
|
||||
func drawPass(r *Renderer, get func(i int) (int32, int32), n int, translucent, cutout bool) {
|
||||
for i := 0; i < n; i++ {
|
||||
x, z := cx(i), cz(i)
|
||||
x, z := get(i)
|
||||
cg, ok := r.chunks[chunkKey(x, z)]
|
||||
if !ok {
|
||||
continue
|
||||
|
||||
@@ -164,7 +164,7 @@ func (r *Renderer) SetAtlas(img image.Image) {
|
||||
gl.BindTexture(gl.TEXTURE_2D, r.atlas)
|
||||
b := img.Bounds()
|
||||
w, h := int32(b.Dx()), int32(b.Dy())
|
||||
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, w, h, 0, gl.RGBA, gl.UNSIGNED_BYTE, imageBytes(img))
|
||||
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, w, h, 0, gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(imageBytes(img)))
|
||||
gl.GenerateMipmap(gl.TEXTURE_2D)
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR)
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
|
||||
@@ -172,7 +172,7 @@ func (r *Renderer) SetAtlas(img image.Image) {
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
|
||||
}
|
||||
|
||||
// imageBytes 把 image.Image 转 RGBA 字节流(预乘无关紧要)。
|
||||
// imageBytes 把 image.Image 转 RGBA 字节流。
|
||||
func imageBytes(img image.Image) []byte {
|
||||
b := img.Bounds()
|
||||
out := make([]byte, 0, b.Dx()*b.Dy()*4)
|
||||
@@ -237,4 +237,4 @@ void main() {
|
||||
float b = max(sky, blk * 0.9 + 0.06);
|
||||
fragColor = vec4(c.rgb * b, c.a);
|
||||
}
|
||||
`
|
||||
`
|
||||
@@ -84,7 +84,7 @@ func (r *Renderer) SetFont(at *font.Atlas) {
|
||||
}
|
||||
gl.BindTexture(gl.TEXTURE_2D, r.fontTex)
|
||||
b := at.Image.Bounds()
|
||||
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, int32(b.Dx()), int32(b.Dy()), 0, gl.RGBA, gl.UNSIGNED_BYTE, imageBytesUI(at.Image))
|
||||
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, int32(b.Dx()), int32(b.Dy()), 0, gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(imageBytesUI(at.Image)))
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
|
||||
@@ -145,26 +145,13 @@ func textrWidth(at *font.Atlas, s string) int {
|
||||
return w
|
||||
}
|
||||
|
||||
// DrawTexImage 上传一张图像为纹理并绘制(长文本/图标用),返回纹理 ID 供缓存。
|
||||
func (r *Renderer) DrawTexImage(x, y float32, img image.Image, scale float32) {
|
||||
var tex uint32
|
||||
gl.GenTextures(1, &tex)
|
||||
gl.BindTexture(gl.TEXTURE_2D, tex)
|
||||
b := img.Bounds()
|
||||
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, int32(b.Dx()), int32(b.Dy()), 0, gl.RGBA, gl.UNSIGNED_BYTE, imageBytesUI(img))
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
|
||||
r.pushQuad(quad{x: x, y: y, w: float32(b.Dx()) * scale, h: float32(b.Dy()) * scale,
|
||||
u0: 0, v0: 0, u1: 1, v1: 1, r: 1, g: 1, b: 1, a: 1, tex: tex})
|
||||
}
|
||||
|
||||
// UploadImage 上传图像为纹理并返回 ID(物品图标/长文本用)。
|
||||
func (r *Renderer) UploadImage(img image.Image) uint32 {
|
||||
var tex uint32
|
||||
gl.GenTextures(1, &tex)
|
||||
gl.BindTexture(gl.TEXTURE_2D, tex)
|
||||
b := img.Bounds()
|
||||
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, int32(b.Dx()), int32(b.Dy()), 0, gl.RGBA, gl.UNSIGNED_BYTE, imageBytesUI(img))
|
||||
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, int32(b.Dx()), int32(b.Dy()), 0, gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(imageBytesUI(img)))
|
||||
gl.GenerateMipmap(gl.TEXTURE_2D)
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR)
|
||||
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
|
||||
@@ -300,7 +287,7 @@ void main() {
|
||||
}
|
||||
`
|
||||
|
||||
// 编译着色器(与 render 包一致的简化版)。
|
||||
// compileShader 编译着色器(与 render 包一致的简化版)。
|
||||
func compileShader(kind uint32, src string) (uint32, error) {
|
||||
s := gl.CreateShader(kind)
|
||||
cs, free := gl.Strs(src + "\x00")
|
||||
@@ -319,4 +306,4 @@ func compileShader(kind uint32, src string) (uint32, error) {
|
||||
return s, nil
|
||||
}
|
||||
|
||||
var _ = textr.New // 保持引用(长文本光栅化路径后置启用)
|
||||
var _ = textr.New // 保持引用(长文本光栅化路径后置启用)
|
||||
@@ -165,8 +165,11 @@ func (w *World) dist(c chunkCoord) float64 {
|
||||
return dx*dx + dz*dz
|
||||
}
|
||||
|
||||
// Block 世界级读方块(未加载区块视为空气)。
|
||||
// Block 世界级读方块(未加载区块与世界边界视为空气)。
|
||||
func (w *World) Block(x, y, z int32) block.State {
|
||||
if y < 0 || y >= chunk.Height {
|
||||
return block.Air
|
||||
}
|
||||
w.mu.Lock()
|
||||
ch := w.chunks[coordKey(coord.ChunkCoord(x), coord.ChunkCoord(z))]
|
||||
w.mu.Unlock()
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*-
|
||||
! Copyright (C) 2019-2025 Free Software Foundation, Inc.
|
||||
! This file is part of the GNU C Library.
|
||||
!
|
||||
! The GNU C Library is free software; you can redistribute it and/or
|
||||
! modify it under the terms of the GNU Lesser General Public
|
||||
! License as published by the Free Software Foundation; either
|
||||
! version 2.1 of the License, or (at your option) any later version.
|
||||
!
|
||||
! The GNU C Library is distributed in the hope that it will be useful,
|
||||
! but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
! Lesser General Public License for more details.
|
||||
!
|
||||
! You should have received a copy of the GNU Lesser General Public
|
||||
! License along with the GNU C Library; if not, see
|
||||
! <https://www.gnu.org/licenses/>.
|
||||
|
||||
!GCC$ builtin (cos) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (cosf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (sin) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (sincos) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (log) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (logf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (exp) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (expf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (pow) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (powf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (acos) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (acosf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (atan) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (atanf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (asin) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (asinf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (hypot) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (hypotf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (exp2) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (exp2f) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (exp10) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (exp10f) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (cosh) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (coshf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (expm1) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (expm1f) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (sinh) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (sinhf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (cbrt) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (cbrtf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (atan2) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (atan2f) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (log10) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (log10f) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (log2) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (log2f) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (log1p) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (log1pf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (atanh) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (atanhf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (acosh) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (acoshf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (erf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (erff) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (tanh) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (tanhf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (asinh) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (asinhf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (erfc) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (erfcf) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (tan) attributes simd (notinbranch) if('x86_64')
|
||||
!GCC$ builtin (tanf) attributes simd (notinbranch) if('x86_64')
|
||||
|
||||
!GCC$ builtin (cos) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (cosf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (sin) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (sinf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (sincos) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (log) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (logf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (exp) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (expf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (pow) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (powf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (acos) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (acosf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (atan) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (atanf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (asin) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (asinf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (hypot) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (hypotf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (exp2) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (exp2f) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (exp10) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (exp10f) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (cosh) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (coshf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (expm1) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (expm1f) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (sinh) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (sinhf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (cbrt) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (cbrtf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (atan2) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (atan2f) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (log10) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (log10f) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (log2) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (log2f) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (log1p) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (log1pf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (atanh) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (atanhf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (acosh) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (acoshf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (erf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (erff) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (tanh) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (tanhf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (asinh) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (asinhf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (erfc) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (erfcf) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (tan) attributes simd (notinbranch) if('x32')
|
||||
!GCC$ builtin (tanf) attributes simd (notinbranch) if('x32')
|
||||
@@ -0,0 +1,108 @@
|
||||
/* FPU control word bits. x86 version.
|
||||
Copyright (C) 1993-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FPU_CONTROL_H
|
||||
#define _FPU_CONTROL_H 1
|
||||
|
||||
/* Note that this file sets on x86-64 only the x87 FPU, it does not
|
||||
touch the SSE unit. */
|
||||
|
||||
/* Here is the dirty part. Set up your 387 through the control word
|
||||
* (cw) register.
|
||||
*
|
||||
* 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0
|
||||
* | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM
|
||||
*
|
||||
* IM: Invalid operation mask
|
||||
* DM: Denormalized operand mask
|
||||
* ZM: Zero-divide mask
|
||||
* OM: Overflow mask
|
||||
* UM: Underflow mask
|
||||
* PM: Precision (inexact result) mask
|
||||
*
|
||||
* Mask bit is 1 means no interrupt.
|
||||
*
|
||||
* PC: Precision control
|
||||
* 11 - round to extended precision
|
||||
* 10 - round to double precision
|
||||
* 00 - round to single precision
|
||||
*
|
||||
* RC: Rounding control
|
||||
* 00 - rounding to nearest
|
||||
* 01 - rounding down (toward - infinity)
|
||||
* 10 - rounding up (toward + infinity)
|
||||
* 11 - rounding toward zero
|
||||
*
|
||||
* IC: Infinity control
|
||||
* That is for 8087 and 80287 only.
|
||||
*
|
||||
* The hardware default is 0x037f which we use.
|
||||
*/
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* masking of interrupts */
|
||||
#define _FPU_MASK_IM 0x01
|
||||
#define _FPU_MASK_DM 0x02
|
||||
#define _FPU_MASK_ZM 0x04
|
||||
#define _FPU_MASK_OM 0x08
|
||||
#define _FPU_MASK_UM 0x10
|
||||
#define _FPU_MASK_PM 0x20
|
||||
|
||||
/* precision control */
|
||||
#define _FPU_EXTENDED 0x300 /* libm requires double extended precision. */
|
||||
#define _FPU_DOUBLE 0x200
|
||||
#define _FPU_SINGLE 0x0
|
||||
|
||||
/* rounding control */
|
||||
#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */
|
||||
#define _FPU_RC_DOWN 0x400
|
||||
#define _FPU_RC_UP 0x800
|
||||
#define _FPU_RC_ZERO 0xC00
|
||||
|
||||
#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */
|
||||
|
||||
|
||||
/* The fdlibm code requires strict IEEE double precision arithmetic,
|
||||
and no interrupts for exceptions, rounding to nearest. */
|
||||
|
||||
#define _FPU_DEFAULT 0x037f
|
||||
|
||||
/* IEEE: same as above. */
|
||||
#define _FPU_IEEE 0x037f
|
||||
|
||||
/* Type of the control word. */
|
||||
typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
|
||||
|
||||
/* Macros for accessing the hardware control word. "*&" is used to
|
||||
work around a bug in older versions of GCC. __volatile__ is used
|
||||
to support combination of writing the control register and reading
|
||||
it back. Without __volatile__, the old value may be used for reading
|
||||
back under compiler optimization.
|
||||
|
||||
Note that the use of these macros is not sufficient anymore with
|
||||
recent hardware nor on x86-64. Some floating point operations are
|
||||
executed in the SSE/SSE2 engines which have their own control and
|
||||
status register. */
|
||||
#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
|
||||
#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
|
||||
|
||||
/* Default control word set at startup. */
|
||||
extern fpu_control_t __fpu_control;
|
||||
|
||||
#endif /* fpu_control.h */
|
||||
@@ -0,0 +1,27 @@
|
||||
/* This file is automatically generated. */
|
||||
#ifndef __GNU_LIB_NAMES_H
|
||||
# error "Never use <gnu/lib-names-x32.h> directly; include <gnu/lib-names.h> instead."
|
||||
#endif
|
||||
|
||||
#define LD_LINUX_X32_SO "ld-linux-x32.so.2"
|
||||
#define LD_SO "ld-linux-x32.so.2"
|
||||
#define LIBANL_SO "libanl.so.1"
|
||||
#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
|
||||
#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
|
||||
#define LIBC_SO "libc.so.6"
|
||||
#define LIBDL_SO "libdl.so.2"
|
||||
#define LIBGCC_S_SO "libgcc_s.so.1"
|
||||
#define LIBMVEC_SO "libmvec.so.1"
|
||||
#define LIBM_SO "libm.so.6"
|
||||
#define LIBNSL_SO "libnsl.so.1"
|
||||
#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
|
||||
#define LIBNSS_DB_SO "libnss_db.so.2"
|
||||
#define LIBNSS_DNS_SO "libnss_dns.so.2"
|
||||
#define LIBNSS_FILES_SO "libnss_files.so.2"
|
||||
#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
|
||||
#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
|
||||
#define LIBPTHREAD_SO "libpthread.so.0"
|
||||
#define LIBRESOLV_SO "libresolv.so.2"
|
||||
#define LIBRT_SO "librt.so.1"
|
||||
#define LIBTHREAD_DB_SO "libthread_db.so.1"
|
||||
#define LIBUTIL_SO "libutil.so.1"
|
||||
@@ -0,0 +1,17 @@
|
||||
/* This file is automatically generated.
|
||||
It defines macros to allow user program to find the shared
|
||||
library files which come as part of GNU libc. */
|
||||
#ifndef __GNU_LIB_NAMES_H
|
||||
#define __GNU_LIB_NAMES_H 1
|
||||
|
||||
#if !defined __x86_64__
|
||||
# include <gnu/lib-names-32.h>
|
||||
#endif
|
||||
#if defined __x86_64__ && defined __LP64__
|
||||
# include <gnu/lib-names-64.h>
|
||||
#endif
|
||||
#if defined __x86_64__ && defined __ILP32__
|
||||
# include <gnu/lib-names-x32.h>
|
||||
#endif
|
||||
|
||||
#endif /* gnu/lib-names.h */
|
||||
@@ -0,0 +1,22 @@
|
||||
/* This file is automatically generated.
|
||||
It defines a symbol `__stub_FUNCTION' for each function
|
||||
in the C library which is a stub, meaning it will fail
|
||||
every time called, usually setting errno to ENOSYS. */
|
||||
|
||||
#ifdef _LIBC
|
||||
#error Applications may not define the macro _LIBC
|
||||
#endif
|
||||
|
||||
#define __stub___compat_bdflush
|
||||
#define __stub___compat_create_module
|
||||
#define __stub___compat_get_kernel_syms
|
||||
#define __stub___compat_nfsservctl
|
||||
#define __stub___compat_query_module
|
||||
#define __stub___compat_uselib
|
||||
#define __stub_chflags
|
||||
#define __stub_fchflags
|
||||
#define __stub_gtty
|
||||
#define __stub_revoke
|
||||
#define __stub_setlogin
|
||||
#define __stub_sigreturn
|
||||
#define __stub_stty
|
||||
@@ -0,0 +1,14 @@
|
||||
/* This file is automatically generated.
|
||||
This file selects the right generated file of `__stub_FUNCTION' macros
|
||||
based on the architecture being compiled for. */
|
||||
|
||||
|
||||
#if !defined __x86_64__
|
||||
# include <gnu/stubs-32.h>
|
||||
#endif
|
||||
#if defined __x86_64__ && defined __LP64__
|
||||
# include <gnu/stubs-64.h>
|
||||
#endif
|
||||
#if defined __x86_64__ && defined __ILP32__
|
||||
# include <gnu/stubs-x32.h>
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
/* Copyright (C) 1998-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_ELF_H
|
||||
#define _SYS_ELF_H 1
|
||||
|
||||
#ifdef __x86_64__
|
||||
# error This header is unsupported on x86-64.
|
||||
#else
|
||||
# warning "This header is obsolete; use <sys/procfs.h> instead."
|
||||
|
||||
# include <sys/procfs.h>
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_ELF_H */
|
||||
@@ -0,0 +1,216 @@
|
||||
/* `ptrace' debugger support interface. Linux/x86 version.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PTRACE_H
|
||||
#define _SYS_PTRACE_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Type of the REQUEST argument to `ptrace.' */
|
||||
enum __ptrace_request
|
||||
{
|
||||
/* Indicate that the process making this request should be traced.
|
||||
All signals received by this process can be intercepted by its
|
||||
parent, and its parent can use the other `ptrace' requests. */
|
||||
PTRACE_TRACEME = 0,
|
||||
#define PT_TRACE_ME PTRACE_TRACEME
|
||||
|
||||
/* Return the word in the process's text space at address ADDR. */
|
||||
PTRACE_PEEKTEXT = 1,
|
||||
#define PT_READ_I PTRACE_PEEKTEXT
|
||||
|
||||
/* Return the word in the process's data space at address ADDR. */
|
||||
PTRACE_PEEKDATA = 2,
|
||||
#define PT_READ_D PTRACE_PEEKDATA
|
||||
|
||||
/* Return the word in the process's user area at offset ADDR. */
|
||||
PTRACE_PEEKUSER = 3,
|
||||
#define PT_READ_U PTRACE_PEEKUSER
|
||||
|
||||
/* Write the word DATA into the process's text space at address ADDR. */
|
||||
PTRACE_POKETEXT = 4,
|
||||
#define PT_WRITE_I PTRACE_POKETEXT
|
||||
|
||||
/* Write the word DATA into the process's data space at address ADDR. */
|
||||
PTRACE_POKEDATA = 5,
|
||||
#define PT_WRITE_D PTRACE_POKEDATA
|
||||
|
||||
/* Write the word DATA into the process's user area at offset ADDR. */
|
||||
PTRACE_POKEUSER = 6,
|
||||
#define PT_WRITE_U PTRACE_POKEUSER
|
||||
|
||||
/* Continue the process. */
|
||||
PTRACE_CONT = 7,
|
||||
#define PT_CONTINUE PTRACE_CONT
|
||||
|
||||
/* Kill the process. */
|
||||
PTRACE_KILL = 8,
|
||||
#define PT_KILL PTRACE_KILL
|
||||
|
||||
/* Single step the process. */
|
||||
PTRACE_SINGLESTEP = 9,
|
||||
#define PT_STEP PTRACE_SINGLESTEP
|
||||
|
||||
/* Get all general purpose registers used by a processes. */
|
||||
PTRACE_GETREGS = 12,
|
||||
#define PT_GETREGS PTRACE_GETREGS
|
||||
|
||||
/* Set all general purpose registers used by a processes. */
|
||||
PTRACE_SETREGS = 13,
|
||||
#define PT_SETREGS PTRACE_SETREGS
|
||||
|
||||
/* Get all floating point registers used by a processes. */
|
||||
PTRACE_GETFPREGS = 14,
|
||||
#define PT_GETFPREGS PTRACE_GETFPREGS
|
||||
|
||||
/* Set all floating point registers used by a processes. */
|
||||
PTRACE_SETFPREGS = 15,
|
||||
#define PT_SETFPREGS PTRACE_SETFPREGS
|
||||
|
||||
/* Attach to a process that is already running. */
|
||||
PTRACE_ATTACH = 16,
|
||||
#define PT_ATTACH PTRACE_ATTACH
|
||||
|
||||
/* Detach from a process attached to with PTRACE_ATTACH. */
|
||||
PTRACE_DETACH = 17,
|
||||
#define PT_DETACH PTRACE_DETACH
|
||||
|
||||
/* Get all extended floating point registers used by a processes. */
|
||||
PTRACE_GETFPXREGS = 18,
|
||||
#define PT_GETFPXREGS PTRACE_GETFPXREGS
|
||||
|
||||
/* Set all extended floating point registers used by a processes. */
|
||||
PTRACE_SETFPXREGS = 19,
|
||||
#define PT_SETFPXREGS PTRACE_SETFPXREGS
|
||||
|
||||
/* Continue and stop at the next entry to or return from syscall. */
|
||||
PTRACE_SYSCALL = 24,
|
||||
#define PT_SYSCALL PTRACE_SYSCALL
|
||||
|
||||
/* Get a TLS entry in the GDT. */
|
||||
PTRACE_GET_THREAD_AREA = 25,
|
||||
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
|
||||
|
||||
/* Change a TLS entry in the GDT. */
|
||||
PTRACE_SET_THREAD_AREA = 26,
|
||||
#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
|
||||
|
||||
#ifdef __x86_64__
|
||||
/* Access TLS data. */
|
||||
PTRACE_ARCH_PRCTL = 30,
|
||||
# define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
|
||||
#endif
|
||||
|
||||
/* Continue and stop at the next syscall, it will not be executed. */
|
||||
PTRACE_SYSEMU = 31,
|
||||
#define PT_SYSEMU PTRACE_SYSEMU
|
||||
|
||||
/* Single step the process, the next syscall will not be executed. */
|
||||
PTRACE_SYSEMU_SINGLESTEP = 32,
|
||||
#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
|
||||
|
||||
/* Execute process until next taken branch. */
|
||||
PTRACE_SINGLEBLOCK = 33,
|
||||
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
|
||||
|
||||
/* Set ptrace filter options. */
|
||||
PTRACE_SETOPTIONS = 0x4200,
|
||||
#define PT_SETOPTIONS PTRACE_SETOPTIONS
|
||||
|
||||
/* Get last ptrace message. */
|
||||
PTRACE_GETEVENTMSG = 0x4201,
|
||||
#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
|
||||
|
||||
/* Get siginfo for process. */
|
||||
PTRACE_GETSIGINFO = 0x4202,
|
||||
#define PT_GETSIGINFO PTRACE_GETSIGINFO
|
||||
|
||||
/* Set new siginfo for process. */
|
||||
PTRACE_SETSIGINFO = 0x4203,
|
||||
#define PT_SETSIGINFO PTRACE_SETSIGINFO
|
||||
|
||||
/* Get register content. */
|
||||
PTRACE_GETREGSET = 0x4204,
|
||||
#define PTRACE_GETREGSET PTRACE_GETREGSET
|
||||
|
||||
/* Set register content. */
|
||||
PTRACE_SETREGSET = 0x4205,
|
||||
#define PTRACE_SETREGSET PTRACE_SETREGSET
|
||||
|
||||
/* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
|
||||
signal or group stop state. */
|
||||
PTRACE_SEIZE = 0x4206,
|
||||
#define PTRACE_SEIZE PTRACE_SEIZE
|
||||
|
||||
/* Trap seized tracee. */
|
||||
PTRACE_INTERRUPT = 0x4207,
|
||||
#define PTRACE_INTERRUPT PTRACE_INTERRUPT
|
||||
|
||||
/* Wait for next group event. */
|
||||
PTRACE_LISTEN = 0x4208,
|
||||
#define PTRACE_LISTEN PTRACE_LISTEN
|
||||
|
||||
/* Retrieve siginfo_t structures without removing signals from a queue. */
|
||||
PTRACE_PEEKSIGINFO = 0x4209,
|
||||
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
|
||||
|
||||
/* Get the mask of blocked signals. */
|
||||
PTRACE_GETSIGMASK = 0x420a,
|
||||
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
|
||||
|
||||
/* Change the mask of blocked signals. */
|
||||
PTRACE_SETSIGMASK = 0x420b,
|
||||
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
|
||||
|
||||
/* Get seccomp BPF filters. */
|
||||
PTRACE_SECCOMP_GET_FILTER = 0x420c,
|
||||
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
|
||||
|
||||
/* Get seccomp BPF filter metadata. */
|
||||
PTRACE_SECCOMP_GET_METADATA = 0x420d,
|
||||
#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
|
||||
|
||||
/* Get information about system call. */
|
||||
PTRACE_GET_SYSCALL_INFO = 0x420e,
|
||||
#define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
|
||||
|
||||
/* Get rseq configuration information. */
|
||||
PTRACE_GET_RSEQ_CONFIGURATION = 0x420f,
|
||||
#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION
|
||||
|
||||
/* Set configuration for syscall user dispatch. */
|
||||
PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210,
|
||||
#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \
|
||||
PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG
|
||||
|
||||
/* Get configuration for syscall user dispatch. */
|
||||
PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211
|
||||
#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \
|
||||
PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG
|
||||
};
|
||||
|
||||
|
||||
#include <bits/ptrace-shared.h>
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_PTRACE_H */
|
||||
@@ -0,0 +1,262 @@
|
||||
/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_UCONTEXT_H
|
||||
#define _SYS_UCONTEXT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types.h>
|
||||
#include <bits/types/sigset_t.h>
|
||||
#include <bits/types/stack_t.h>
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# define __ctx(fld) fld
|
||||
#else
|
||||
# define __ctx(fld) __ ## fld
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
/* Type for general register. */
|
||||
__extension__ typedef long long int greg_t;
|
||||
|
||||
/* Number of general registers. */
|
||||
#define __NGREG 23
|
||||
#ifdef __USE_MISC
|
||||
# define NGREG __NGREG
|
||||
#endif
|
||||
|
||||
/* Container for all general registers. */
|
||||
typedef greg_t gregset_t[__NGREG];
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Number of each register in the `gregset_t' array. */
|
||||
enum
|
||||
{
|
||||
REG_R8 = 0,
|
||||
# define REG_R8 REG_R8
|
||||
REG_R9,
|
||||
# define REG_R9 REG_R9
|
||||
REG_R10,
|
||||
# define REG_R10 REG_R10
|
||||
REG_R11,
|
||||
# define REG_R11 REG_R11
|
||||
REG_R12,
|
||||
# define REG_R12 REG_R12
|
||||
REG_R13,
|
||||
# define REG_R13 REG_R13
|
||||
REG_R14,
|
||||
# define REG_R14 REG_R14
|
||||
REG_R15,
|
||||
# define REG_R15 REG_R15
|
||||
REG_RDI,
|
||||
# define REG_RDI REG_RDI
|
||||
REG_RSI,
|
||||
# define REG_RSI REG_RSI
|
||||
REG_RBP,
|
||||
# define REG_RBP REG_RBP
|
||||
REG_RBX,
|
||||
# define REG_RBX REG_RBX
|
||||
REG_RDX,
|
||||
# define REG_RDX REG_RDX
|
||||
REG_RAX,
|
||||
# define REG_RAX REG_RAX
|
||||
REG_RCX,
|
||||
# define REG_RCX REG_RCX
|
||||
REG_RSP,
|
||||
# define REG_RSP REG_RSP
|
||||
REG_RIP,
|
||||
# define REG_RIP REG_RIP
|
||||
REG_EFL,
|
||||
# define REG_EFL REG_EFL
|
||||
REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */
|
||||
# define REG_CSGSFS REG_CSGSFS
|
||||
REG_ERR,
|
||||
# define REG_ERR REG_ERR
|
||||
REG_TRAPNO,
|
||||
# define REG_TRAPNO REG_TRAPNO
|
||||
REG_OLDMASK,
|
||||
# define REG_OLDMASK REG_OLDMASK
|
||||
REG_CR2
|
||||
# define REG_CR2 REG_CR2
|
||||
};
|
||||
#endif
|
||||
|
||||
struct _libc_fpxreg
|
||||
{
|
||||
unsigned short int __ctx(significand)[4];
|
||||
unsigned short int __ctx(exponent);
|
||||
unsigned short int __glibc_reserved1[3];
|
||||
};
|
||||
|
||||
struct _libc_xmmreg
|
||||
{
|
||||
__uint32_t __ctx(element)[4];
|
||||
};
|
||||
|
||||
struct _libc_fpstate
|
||||
{
|
||||
/* 64-bit FXSAVE format. */
|
||||
__uint16_t __ctx(cwd);
|
||||
__uint16_t __ctx(swd);
|
||||
__uint16_t __ctx(ftw);
|
||||
__uint16_t __ctx(fop);
|
||||
__uint64_t __ctx(rip);
|
||||
__uint64_t __ctx(rdp);
|
||||
__uint32_t __ctx(mxcsr);
|
||||
__uint32_t __ctx(mxcr_mask);
|
||||
struct _libc_fpxreg _st[8];
|
||||
struct _libc_xmmreg _xmm[16];
|
||||
__uint32_t __glibc_reserved1[24];
|
||||
};
|
||||
|
||||
/* Structure to describe FPU registers. */
|
||||
typedef struct _libc_fpstate *fpregset_t;
|
||||
|
||||
/* Context to describe whole processor state. */
|
||||
typedef struct
|
||||
{
|
||||
gregset_t __ctx(gregs);
|
||||
/* Note that fpregs is a pointer. */
|
||||
fpregset_t __ctx(fpregs);
|
||||
__extension__ unsigned long long __reserved1 [8];
|
||||
} mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext_t
|
||||
{
|
||||
unsigned long int __ctx(uc_flags);
|
||||
struct ucontext_t *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
struct _libc_fpstate __fpregs_mem;
|
||||
__extension__ unsigned long long int __ssp[4];
|
||||
} ucontext_t;
|
||||
|
||||
#else /* !__x86_64__ */
|
||||
|
||||
/* Type for general register. */
|
||||
typedef int greg_t;
|
||||
|
||||
/* Number of general registers. */
|
||||
#define __NGREG 19
|
||||
#ifdef __USE_MISC
|
||||
# define NGREG __NGREG
|
||||
#endif
|
||||
|
||||
/* Container for all general registers. */
|
||||
typedef greg_t gregset_t[__NGREG];
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Number of each register is the `gregset_t' array. */
|
||||
enum
|
||||
{
|
||||
REG_GS = 0,
|
||||
# define REG_GS REG_GS
|
||||
REG_FS,
|
||||
# define REG_FS REG_FS
|
||||
REG_ES,
|
||||
# define REG_ES REG_ES
|
||||
REG_DS,
|
||||
# define REG_DS REG_DS
|
||||
REG_EDI,
|
||||
# define REG_EDI REG_EDI
|
||||
REG_ESI,
|
||||
# define REG_ESI REG_ESI
|
||||
REG_EBP,
|
||||
# define REG_EBP REG_EBP
|
||||
REG_ESP,
|
||||
# define REG_ESP REG_ESP
|
||||
REG_EBX,
|
||||
# define REG_EBX REG_EBX
|
||||
REG_EDX,
|
||||
# define REG_EDX REG_EDX
|
||||
REG_ECX,
|
||||
# define REG_ECX REG_ECX
|
||||
REG_EAX,
|
||||
# define REG_EAX REG_EAX
|
||||
REG_TRAPNO,
|
||||
# define REG_TRAPNO REG_TRAPNO
|
||||
REG_ERR,
|
||||
# define REG_ERR REG_ERR
|
||||
REG_EIP,
|
||||
# define REG_EIP REG_EIP
|
||||
REG_CS,
|
||||
# define REG_CS REG_CS
|
||||
REG_EFL,
|
||||
# define REG_EFL REG_EFL
|
||||
REG_UESP,
|
||||
# define REG_UESP REG_UESP
|
||||
REG_SS
|
||||
# define REG_SS REG_SS
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Definitions taken from the kernel headers. */
|
||||
struct _libc_fpreg
|
||||
{
|
||||
unsigned short int __ctx(significand)[4];
|
||||
unsigned short int __ctx(exponent);
|
||||
};
|
||||
|
||||
struct _libc_fpstate
|
||||
{
|
||||
unsigned long int __ctx(cw);
|
||||
unsigned long int __ctx(sw);
|
||||
unsigned long int __ctx(tag);
|
||||
unsigned long int __ctx(ipoff);
|
||||
unsigned long int __ctx(cssel);
|
||||
unsigned long int __ctx(dataoff);
|
||||
unsigned long int __ctx(datasel);
|
||||
struct _libc_fpreg _st[8];
|
||||
unsigned long int __ctx(status);
|
||||
};
|
||||
|
||||
/* Structure to describe FPU registers. */
|
||||
typedef struct _libc_fpstate *fpregset_t;
|
||||
|
||||
/* Context to describe whole processor state. */
|
||||
typedef struct
|
||||
{
|
||||
gregset_t __ctx(gregs);
|
||||
/* Due to Linux's history we have to use a pointer here. The SysV/i386
|
||||
ABI requires a struct with the values. */
|
||||
fpregset_t __ctx(fpregs);
|
||||
unsigned long int __ctx(oldmask);
|
||||
unsigned long int __ctx(cr2);
|
||||
} mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext_t
|
||||
{
|
||||
unsigned long int __ctx(uc_flags);
|
||||
struct ucontext_t *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
struct _libc_fpstate __fpregs_mem;
|
||||
unsigned long int __ssp[4];
|
||||
} ucontext_t;
|
||||
|
||||
#endif /* !__x86_64__ */
|
||||
|
||||
#undef __ctx
|
||||
|
||||
#endif /* sys/ucontext.h */
|
||||
@@ -0,0 +1,180 @@
|
||||
/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_USER_H
|
||||
#define _SYS_USER_H 1
|
||||
|
||||
/* The whole purpose of this file is for GDB and GDB only. Don't read
|
||||
too much into it. Don't use it for anything other than GDB unless
|
||||
you know what you are doing. */
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
struct user_fpregs_struct
|
||||
{
|
||||
unsigned short int cwd;
|
||||
unsigned short int swd;
|
||||
unsigned short int ftw;
|
||||
unsigned short int fop;
|
||||
__extension__ unsigned long long int rip;
|
||||
__extension__ unsigned long long int rdp;
|
||||
unsigned int mxcsr;
|
||||
unsigned int mxcr_mask;
|
||||
unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
|
||||
unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
|
||||
unsigned int padding[24];
|
||||
};
|
||||
|
||||
struct user_regs_struct
|
||||
{
|
||||
__extension__ unsigned long long int r15;
|
||||
__extension__ unsigned long long int r14;
|
||||
__extension__ unsigned long long int r13;
|
||||
__extension__ unsigned long long int r12;
|
||||
__extension__ unsigned long long int rbp;
|
||||
__extension__ unsigned long long int rbx;
|
||||
__extension__ unsigned long long int r11;
|
||||
__extension__ unsigned long long int r10;
|
||||
__extension__ unsigned long long int r9;
|
||||
__extension__ unsigned long long int r8;
|
||||
__extension__ unsigned long long int rax;
|
||||
__extension__ unsigned long long int rcx;
|
||||
__extension__ unsigned long long int rdx;
|
||||
__extension__ unsigned long long int rsi;
|
||||
__extension__ unsigned long long int rdi;
|
||||
__extension__ unsigned long long int orig_rax;
|
||||
__extension__ unsigned long long int rip;
|
||||
__extension__ unsigned long long int cs;
|
||||
__extension__ unsigned long long int eflags;
|
||||
__extension__ unsigned long long int rsp;
|
||||
__extension__ unsigned long long int ss;
|
||||
__extension__ unsigned long long int fs_base;
|
||||
__extension__ unsigned long long int gs_base;
|
||||
__extension__ unsigned long long int ds;
|
||||
__extension__ unsigned long long int es;
|
||||
__extension__ unsigned long long int fs;
|
||||
__extension__ unsigned long long int gs;
|
||||
};
|
||||
|
||||
struct user
|
||||
{
|
||||
struct user_regs_struct regs;
|
||||
int u_fpvalid;
|
||||
struct user_fpregs_struct i387;
|
||||
__extension__ unsigned long long int u_tsize;
|
||||
__extension__ unsigned long long int u_dsize;
|
||||
__extension__ unsigned long long int u_ssize;
|
||||
__extension__ unsigned long long int start_code;
|
||||
__extension__ unsigned long long int start_stack;
|
||||
__extension__ long long int signal;
|
||||
int reserved;
|
||||
__extension__ union
|
||||
{
|
||||
struct user_regs_struct* u_ar0;
|
||||
__extension__ unsigned long long int __u_ar0_word;
|
||||
};
|
||||
__extension__ union
|
||||
{
|
||||
struct user_fpregs_struct* u_fpstate;
|
||||
__extension__ unsigned long long int __u_fpstate_word;
|
||||
};
|
||||
__extension__ unsigned long long int magic;
|
||||
char u_comm [32];
|
||||
__extension__ unsigned long long int u_debugreg [8];
|
||||
};
|
||||
|
||||
#else
|
||||
/* These are the 32-bit x86 structures. */
|
||||
struct user_fpregs_struct
|
||||
{
|
||||
long int cwd;
|
||||
long int swd;
|
||||
long int twd;
|
||||
long int fip;
|
||||
long int fcs;
|
||||
long int foo;
|
||||
long int fos;
|
||||
long int st_space [20];
|
||||
};
|
||||
|
||||
struct user_fpxregs_struct
|
||||
{
|
||||
unsigned short int cwd;
|
||||
unsigned short int swd;
|
||||
unsigned short int twd;
|
||||
unsigned short int fop;
|
||||
long int fip;
|
||||
long int fcs;
|
||||
long int foo;
|
||||
long int fos;
|
||||
long int mxcsr;
|
||||
long int reserved;
|
||||
long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
|
||||
long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
|
||||
long int padding[56];
|
||||
};
|
||||
|
||||
struct user_regs_struct
|
||||
{
|
||||
long int ebx;
|
||||
long int ecx;
|
||||
long int edx;
|
||||
long int esi;
|
||||
long int edi;
|
||||
long int ebp;
|
||||
long int eax;
|
||||
long int xds;
|
||||
long int xes;
|
||||
long int xfs;
|
||||
long int xgs;
|
||||
long int orig_eax;
|
||||
long int eip;
|
||||
long int xcs;
|
||||
long int eflags;
|
||||
long int esp;
|
||||
long int xss;
|
||||
};
|
||||
|
||||
struct user
|
||||
{
|
||||
struct user_regs_struct regs;
|
||||
int u_fpvalid;
|
||||
struct user_fpregs_struct i387;
|
||||
unsigned long int u_tsize;
|
||||
unsigned long int u_dsize;
|
||||
unsigned long int u_ssize;
|
||||
unsigned long int start_code;
|
||||
unsigned long int start_stack;
|
||||
long int signal;
|
||||
int reserved;
|
||||
struct user_regs_struct* u_ar0;
|
||||
struct user_fpregs_struct* u_fpstate;
|
||||
unsigned long int magic;
|
||||
char u_comm [32];
|
||||
int u_debugreg [8];
|
||||
};
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#define PAGE_SHIFT 12
|
||||
#define PAGE_SIZE (1UL << PAGE_SHIFT)
|
||||
#define PAGE_MASK (~(PAGE_SIZE-1))
|
||||
#define NBPG PAGE_SIZE
|
||||
#define UPAGES 1
|
||||
#define HOST_TEXT_START_ADDR (u.start_code)
|
||||
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
|
||||
|
||||
#endif /* _SYS_USER_H */
|
||||
@@ -0,0 +1,415 @@
|
||||
#define _Addr long
|
||||
#define _Int64 long
|
||||
#define _Reg long
|
||||
|
||||
#define __BYTE_ORDER 1234
|
||||
#define __LONG_MAX 0x7fffffffffffffffL
|
||||
|
||||
#ifndef __cplusplus
|
||||
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
|
||||
typedef int wchar_t;
|
||||
#define __DEFINED_wchar_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
|
||||
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
|
||||
typedef long double float_t;
|
||||
#define __DEFINED_float_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
|
||||
typedef long double double_t;
|
||||
#define __DEFINED_double_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
|
||||
typedef float float_t;
|
||||
#define __DEFINED_float_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
|
||||
typedef double double_t;
|
||||
#define __DEFINED_double_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
|
||||
typedef struct { long long __ll; long double __ld; } max_align_t;
|
||||
#define __DEFINED_max_align_t
|
||||
#endif
|
||||
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#define __BIG_ENDIAN 4321
|
||||
#define __USE_TIME_BITS64 1
|
||||
|
||||
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
|
||||
typedef unsigned _Addr size_t;
|
||||
#define __DEFINED_size_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
|
||||
typedef unsigned _Addr uintptr_t;
|
||||
#define __DEFINED_uintptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
|
||||
typedef _Addr ptrdiff_t;
|
||||
#define __DEFINED_ptrdiff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
|
||||
typedef _Addr ssize_t;
|
||||
#define __DEFINED_ssize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
|
||||
typedef _Addr intptr_t;
|
||||
#define __DEFINED_intptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
|
||||
typedef _Addr regoff_t;
|
||||
#define __DEFINED_regoff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
|
||||
typedef _Reg register_t;
|
||||
#define __DEFINED_register_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
|
||||
typedef _Int64 time_t;
|
||||
#define __DEFINED_time_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
|
||||
typedef _Int64 suseconds_t;
|
||||
#define __DEFINED_suseconds_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
|
||||
typedef signed char int8_t;
|
||||
#define __DEFINED_int8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
|
||||
typedef signed short int16_t;
|
||||
#define __DEFINED_int16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
|
||||
typedef signed int int32_t;
|
||||
#define __DEFINED_int32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
|
||||
typedef signed _Int64 int64_t;
|
||||
#define __DEFINED_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
|
||||
typedef signed _Int64 intmax_t;
|
||||
#define __DEFINED_intmax_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
|
||||
typedef unsigned char uint8_t;
|
||||
#define __DEFINED_uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
|
||||
typedef unsigned short uint16_t;
|
||||
#define __DEFINED_uint16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
|
||||
typedef unsigned int uint32_t;
|
||||
#define __DEFINED_uint32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
|
||||
typedef unsigned _Int64 uint64_t;
|
||||
#define __DEFINED_uint64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
|
||||
typedef unsigned _Int64 u_int64_t;
|
||||
#define __DEFINED_u_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
|
||||
typedef unsigned _Int64 uintmax_t;
|
||||
#define __DEFINED_uintmax_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
|
||||
typedef unsigned mode_t;
|
||||
#define __DEFINED_mode_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
|
||||
typedef unsigned _Reg nlink_t;
|
||||
#define __DEFINED_nlink_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
|
||||
typedef _Int64 off_t;
|
||||
#define __DEFINED_off_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
|
||||
typedef unsigned _Int64 ino_t;
|
||||
#define __DEFINED_ino_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
|
||||
typedef unsigned _Int64 dev_t;
|
||||
#define __DEFINED_dev_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
|
||||
typedef long blksize_t;
|
||||
#define __DEFINED_blksize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
|
||||
typedef _Int64 blkcnt_t;
|
||||
#define __DEFINED_blkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
|
||||
typedef unsigned _Int64 fsblkcnt_t;
|
||||
#define __DEFINED_fsblkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
|
||||
typedef unsigned _Int64 fsfilcnt_t;
|
||||
#define __DEFINED_fsfilcnt_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
|
||||
typedef unsigned wint_t;
|
||||
#define __DEFINED_wint_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
|
||||
typedef unsigned long wctype_t;
|
||||
#define __DEFINED_wctype_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
|
||||
typedef void * timer_t;
|
||||
#define __DEFINED_timer_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
|
||||
typedef int clockid_t;
|
||||
#define __DEFINED_clockid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
|
||||
typedef long clock_t;
|
||||
#define __DEFINED_clock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
|
||||
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
|
||||
#define __DEFINED_struct_timeval
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
|
||||
struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
|
||||
#define __DEFINED_struct_timespec
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
|
||||
typedef int pid_t;
|
||||
#define __DEFINED_pid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
|
||||
typedef unsigned id_t;
|
||||
#define __DEFINED_id_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
|
||||
typedef unsigned uid_t;
|
||||
#define __DEFINED_uid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
|
||||
typedef unsigned gid_t;
|
||||
#define __DEFINED_gid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
|
||||
typedef int key_t;
|
||||
#define __DEFINED_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
|
||||
typedef unsigned useconds_t;
|
||||
#define __DEFINED_useconds_t
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef unsigned long pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef struct __pthread * pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
|
||||
typedef int pthread_once_t;
|
||||
#define __DEFINED_pthread_once_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
|
||||
typedef unsigned pthread_key_t;
|
||||
#define __DEFINED_pthread_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
|
||||
typedef int pthread_spinlock_t;
|
||||
#define __DEFINED_pthread_spinlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_mutexattr_t;
|
||||
#define __DEFINED_pthread_mutexattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_condattr_t;
|
||||
#define __DEFINED_pthread_condattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_barrierattr_t;
|
||||
#define __DEFINED_pthread_barrierattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
|
||||
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
|
||||
#define __DEFINED_pthread_rwlockattr_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE)
|
||||
struct _IO_FILE { char __x; };
|
||||
#define __DEFINED_struct__IO_FILE
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
|
||||
typedef struct _IO_FILE FILE;
|
||||
#define __DEFINED_FILE
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
|
||||
typedef __builtin_va_list va_list;
|
||||
#define __DEFINED_va_list
|
||||
#endif
|
||||
|
||||
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
|
||||
typedef __builtin_va_list __isoc_va_list;
|
||||
#define __DEFINED___isoc_va_list
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
|
||||
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
|
||||
#define __DEFINED_mbstate_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
|
||||
typedef struct __locale_struct * locale_t;
|
||||
#define __DEFINED_locale_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
|
||||
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
|
||||
#define __DEFINED_sigset_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
|
||||
struct iovec { void *iov_base; size_t iov_len; };
|
||||
#define __DEFINED_struct_iovec
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
|
||||
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
|
||||
#define __DEFINED_struct_winsize
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
|
||||
typedef unsigned socklen_t;
|
||||
#define __DEFINED_socklen_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
|
||||
typedef unsigned short sa_family_t;
|
||||
#define __DEFINED_sa_family_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
|
||||
#define __DEFINED_pthread_attr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
|
||||
#define __DEFINED_pthread_mutex_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
|
||||
#define __DEFINED_mtx_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
|
||||
#define __DEFINED_pthread_cond_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
|
||||
#define __DEFINED_cnd_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
|
||||
#define __DEFINED_pthread_rwlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
|
||||
#define __DEFINED_pthread_barrier_t
|
||||
#endif
|
||||
|
||||
|
||||
#undef _Addr
|
||||
#undef _Int64
|
||||
#undef _Reg
|
||||
@@ -0,0 +1,34 @@
|
||||
#define FE_INVALID 1
|
||||
#define __FE_DENORM 2
|
||||
#define FE_DIVBYZERO 4
|
||||
#define FE_OVERFLOW 8
|
||||
#define FE_UNDERFLOW 16
|
||||
#define FE_INEXACT 32
|
||||
|
||||
#define FE_ALL_EXCEPT 63
|
||||
|
||||
#define FE_TONEAREST 0
|
||||
#define FE_DOWNWARD 0x400
|
||||
#define FE_UPWARD 0x800
|
||||
#define FE_TOWARDZERO 0xc00
|
||||
|
||||
typedef unsigned short fexcept_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned short __control_word;
|
||||
unsigned short __unused1;
|
||||
unsigned short __status_word;
|
||||
unsigned short __unused2;
|
||||
unsigned short __tags;
|
||||
unsigned short __unused3;
|
||||
unsigned int __eip;
|
||||
unsigned short __cs_selector;
|
||||
unsigned int __opcode:11;
|
||||
unsigned int __unused4:5;
|
||||
unsigned int __data_offset;
|
||||
unsigned short __data_selector;
|
||||
unsigned short __unused5;
|
||||
unsigned int __mxcsr;
|
||||
} fenv_t;
|
||||
|
||||
#define FE_DFL_ENV ((const fenv_t *) -1)
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifdef __FLT_EVAL_METHOD__
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
#else
|
||||
#define FLT_EVAL_METHOD 0
|
||||
#endif
|
||||
|
||||
#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
|
||||
#define LDBL_MIN 3.3621031431120935063e-4932L
|
||||
#define LDBL_MAX 1.1897314953572317650e+4932L
|
||||
#define LDBL_EPSILON 1.0842021724855044340e-19L
|
||||
|
||||
#define LDBL_MANT_DIG 64
|
||||
#define LDBL_MIN_EXP (-16381)
|
||||
#define LDBL_MAX_EXP 16384
|
||||
|
||||
#define LDBL_DIG 18
|
||||
#define LDBL_MIN_10_EXP (-4931)
|
||||
#define LDBL_MAX_10_EXP 4932
|
||||
|
||||
#define DECIMAL_DIG 21
|
||||
@@ -0,0 +1,77 @@
|
||||
static __inline void outb(unsigned char __val, unsigned short __port)
|
||||
{
|
||||
__asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
|
||||
}
|
||||
|
||||
static __inline void outw(unsigned short __val, unsigned short __port)
|
||||
{
|
||||
__asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
|
||||
}
|
||||
|
||||
static __inline void outl(unsigned int __val, unsigned short __port)
|
||||
{
|
||||
__asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
|
||||
}
|
||||
|
||||
static __inline unsigned char inb(unsigned short __port)
|
||||
{
|
||||
unsigned char __val;
|
||||
__asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
|
||||
return __val;
|
||||
}
|
||||
|
||||
static __inline unsigned short inw(unsigned short __port)
|
||||
{
|
||||
unsigned short __val;
|
||||
__asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
|
||||
return __val;
|
||||
}
|
||||
|
||||
static __inline unsigned int inl(unsigned short __port)
|
||||
{
|
||||
unsigned int __val;
|
||||
__asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
|
||||
return __val;
|
||||
}
|
||||
|
||||
static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; outsb"
|
||||
: "+S" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; outsw"
|
||||
: "+S" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; outsl"
|
||||
: "+S" (__buf), "+c"(__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; insb"
|
||||
: "+D" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; insw"
|
||||
: "+D" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; insl"
|
||||
: "+D" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
#define PAGESIZE 4096
|
||||
@@ -0,0 +1 @@
|
||||
#define MAP_32BIT 0x40
|
||||
@@ -0,0 +1,2 @@
|
||||
#define _POSIX_V6_LP64_OFF64 1
|
||||
#define _POSIX_V7_LP64_OFF64 1
|
||||
@@ -0,0 +1,13 @@
|
||||
#define PTRACE_GET_THREAD_AREA 25
|
||||
#define PTRACE_SET_THREAD_AREA 26
|
||||
#define PTRACE_ARCH_PRCTL 30
|
||||
#define PTRACE_SYSEMU 31
|
||||
#define PTRACE_SYSEMU_SINGLESTEP 32
|
||||
#define PTRACE_SINGLEBLOCK 33
|
||||
|
||||
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
|
||||
#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
|
||||
#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
|
||||
#define PT_SYSEMU PTRACE_SYSEMU
|
||||
#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
|
||||
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
|
||||
@@ -0,0 +1,29 @@
|
||||
#undef __WORDSIZE
|
||||
#define __WORDSIZE 64
|
||||
#define R15 0
|
||||
#define R14 1
|
||||
#define R13 2
|
||||
#define R12 3
|
||||
#define RBP 4
|
||||
#define RBX 5
|
||||
#define R11 6
|
||||
#define R10 7
|
||||
#define R9 8
|
||||
#define R8 9
|
||||
#define RAX 10
|
||||
#define RCX 11
|
||||
#define RDX 12
|
||||
#define RSI 13
|
||||
#define RDI 14
|
||||
#define ORIG_RAX 15
|
||||
#define RIP 16
|
||||
#define CS 17
|
||||
#define EFLAGS 18
|
||||
#define RSP 19
|
||||
#define SS 20
|
||||
#define FS_BASE 21
|
||||
#define GS_BASE 22
|
||||
#define DS 23
|
||||
#define ES 24
|
||||
#define FS 25
|
||||
#define GS 26
|
||||
@@ -0,0 +1,11 @@
|
||||
struct semid_ds {
|
||||
struct ipc_perm sem_perm;
|
||||
time_t sem_otime;
|
||||
long __unused1;
|
||||
time_t sem_ctime;
|
||||
long __unused2;
|
||||
unsigned short sem_nsems;
|
||||
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
|
||||
long __unused3;
|
||||
long __unused4;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
typedef unsigned long __jmp_buf[8];
|
||||
@@ -0,0 +1,152 @@
|
||||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define MINSIGSTKSZ 2048
|
||||
#define SIGSTKSZ 8192
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
enum { REG_R8 = 0 };
|
||||
#define REG_R8 REG_R8
|
||||
enum { REG_R9 = 1 };
|
||||
#define REG_R9 REG_R9
|
||||
enum { REG_R10 = 2 };
|
||||
#define REG_R10 REG_R10
|
||||
enum { REG_R11 = 3 };
|
||||
#define REG_R11 REG_R11
|
||||
enum { REG_R12 = 4 };
|
||||
#define REG_R12 REG_R12
|
||||
enum { REG_R13 = 5 };
|
||||
#define REG_R13 REG_R13
|
||||
enum { REG_R14 = 6 };
|
||||
#define REG_R14 REG_R14
|
||||
enum { REG_R15 = 7 };
|
||||
#define REG_R15 REG_R15
|
||||
enum { REG_RDI = 8 };
|
||||
#define REG_RDI REG_RDI
|
||||
enum { REG_RSI = 9 };
|
||||
#define REG_RSI REG_RSI
|
||||
enum { REG_RBP = 10 };
|
||||
#define REG_RBP REG_RBP
|
||||
enum { REG_RBX = 11 };
|
||||
#define REG_RBX REG_RBX
|
||||
enum { REG_RDX = 12 };
|
||||
#define REG_RDX REG_RDX
|
||||
enum { REG_RAX = 13 };
|
||||
#define REG_RAX REG_RAX
|
||||
enum { REG_RCX = 14 };
|
||||
#define REG_RCX REG_RCX
|
||||
enum { REG_RSP = 15 };
|
||||
#define REG_RSP REG_RSP
|
||||
enum { REG_RIP = 16 };
|
||||
#define REG_RIP REG_RIP
|
||||
enum { REG_EFL = 17 };
|
||||
#define REG_EFL REG_EFL
|
||||
enum { REG_CSGSFS = 18 };
|
||||
#define REG_CSGSFS REG_CSGSFS
|
||||
enum { REG_ERR = 19 };
|
||||
#define REG_ERR REG_ERR
|
||||
enum { REG_TRAPNO = 20 };
|
||||
#define REG_TRAPNO REG_TRAPNO
|
||||
enum { REG_OLDMASK = 21 };
|
||||
#define REG_OLDMASK REG_OLDMASK
|
||||
enum { REG_CR2 = 22 };
|
||||
#define REG_CR2 REG_CR2
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
typedef long long greg_t, gregset_t[23];
|
||||
typedef struct _fpstate {
|
||||
unsigned short cwd, swd, ftw, fop;
|
||||
unsigned long long rip, rdp;
|
||||
unsigned mxcsr, mxcr_mask;
|
||||
struct {
|
||||
unsigned short significand[4], exponent, padding[3];
|
||||
} _st[8];
|
||||
struct {
|
||||
unsigned element[4];
|
||||
} _xmm[16];
|
||||
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 short cs, gs, fs, __pad0;
|
||||
unsigned long err, trapno, oldmask, cr2;
|
||||
struct _fpstate *fpstate;
|
||||
unsigned long __reserved1[8];
|
||||
};
|
||||
typedef struct {
|
||||
gregset_t gregs;
|
||||
fpregset_t fpregs;
|
||||
unsigned long long __reserved1[8];
|
||||
} mcontext_t;
|
||||
#else
|
||||
typedef struct {
|
||||
unsigned long __space[32];
|
||||
} mcontext_t;
|
||||
#endif
|
||||
|
||||
struct sigaltstack {
|
||||
void *ss_sp;
|
||||
int ss_flags;
|
||||
size_t ss_size;
|
||||
};
|
||||
|
||||
typedef struct __ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct __ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
unsigned long __fpregs_mem[64];
|
||||
} ucontext_t;
|
||||
|
||||
#define SA_NOCLDSTOP 1
|
||||
#define SA_NOCLDWAIT 2
|
||||
#define SA_SIGINFO 4
|
||||
#define SA_ONSTACK 0x08000000
|
||||
#define SA_RESTART 0x10000000
|
||||
#define SA_NODEFER 0x40000000
|
||||
#define SA_RESETHAND 0x80000000
|
||||
#define SA_RESTORER 0x04000000
|
||||
|
||||
#endif
|
||||
|
||||
#define SIGHUP 1
|
||||
#define SIGINT 2
|
||||
#define SIGQUIT 3
|
||||
#define SIGILL 4
|
||||
#define SIGTRAP 5
|
||||
#define SIGABRT 6
|
||||
#define SIGIOT SIGABRT
|
||||
#define SIGBUS 7
|
||||
#define SIGFPE 8
|
||||
#define SIGKILL 9
|
||||
#define SIGUSR1 10
|
||||
#define SIGSEGV 11
|
||||
#define SIGUSR2 12
|
||||
#define SIGPIPE 13
|
||||
#define SIGALRM 14
|
||||
#define SIGTERM 15
|
||||
#define SIGSTKFLT 16
|
||||
#define SIGCHLD 17
|
||||
#define SIGCONT 18
|
||||
#define SIGSTOP 19
|
||||
#define SIGTSTP 20
|
||||
#define SIGTTIN 21
|
||||
#define SIGTTOU 22
|
||||
#define SIGURG 23
|
||||
#define SIGXCPU 24
|
||||
#define SIGXFSZ 25
|
||||
#define SIGVTALRM 26
|
||||
#define SIGPROF 27
|
||||
#define SIGWINCH 28
|
||||
#define SIGIO 29
|
||||
#define SIGPOLL 29
|
||||
#define SIGPWR 30
|
||||
#define SIGSYS 31
|
||||
#define SIGUNUSED SIGSYS
|
||||
|
||||
#define _NSIG 65
|
||||
@@ -0,0 +1,22 @@
|
||||
/* copied from kernel definition, but with padding replaced
|
||||
* by the corresponding correctly-sized userspace types. */
|
||||
|
||||
struct stat {
|
||||
dev_t st_dev;
|
||||
ino_t st_ino;
|
||||
nlink_t st_nlink;
|
||||
|
||||
mode_t st_mode;
|
||||
uid_t st_uid;
|
||||
gid_t st_gid;
|
||||
unsigned int __pad0;
|
||||
dev_t st_rdev;
|
||||
off_t st_size;
|
||||
blksize_t st_blksize;
|
||||
blkcnt_t st_blocks;
|
||||
|
||||
struct timespec st_atim;
|
||||
struct timespec st_mtim;
|
||||
struct timespec st_ctim;
|
||||
long __unused[3];
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
typedef int32_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef uint32_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
|
||||
#define INT_FAST16_MIN INT32_MIN
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
|
||||
#define INT_FAST16_MAX INT32_MAX
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
|
||||
#define UINT_FAST16_MAX UINT32_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
|
||||
#define INTPTR_MIN INT64_MIN
|
||||
#define INTPTR_MAX INT64_MAX
|
||||
#define UINTPTR_MAX UINT64_MAX
|
||||
#define PTRDIFF_MIN INT64_MIN
|
||||
#define PTRDIFF_MAX INT64_MAX
|
||||
#define SIZE_MAX UINT64_MAX
|
||||
@@ -0,0 +1,727 @@
|
||||
#define __NR_read 0
|
||||
#define __NR_write 1
|
||||
#define __NR_open 2
|
||||
#define __NR_close 3
|
||||
#define __NR_stat 4
|
||||
#define __NR_fstat 5
|
||||
#define __NR_lstat 6
|
||||
#define __NR_poll 7
|
||||
#define __NR_lseek 8
|
||||
#define __NR_mmap 9
|
||||
#define __NR_mprotect 10
|
||||
#define __NR_munmap 11
|
||||
#define __NR_brk 12
|
||||
#define __NR_rt_sigaction 13
|
||||
#define __NR_rt_sigprocmask 14
|
||||
#define __NR_rt_sigreturn 15
|
||||
#define __NR_ioctl 16
|
||||
#define __NR_pread64 17
|
||||
#define __NR_pwrite64 18
|
||||
#define __NR_readv 19
|
||||
#define __NR_writev 20
|
||||
#define __NR_access 21
|
||||
#define __NR_pipe 22
|
||||
#define __NR_select 23
|
||||
#define __NR_sched_yield 24
|
||||
#define __NR_mremap 25
|
||||
#define __NR_msync 26
|
||||
#define __NR_mincore 27
|
||||
#define __NR_madvise 28
|
||||
#define __NR_shmget 29
|
||||
#define __NR_shmat 30
|
||||
#define __NR_shmctl 31
|
||||
#define __NR_dup 32
|
||||
#define __NR_dup2 33
|
||||
#define __NR_pause 34
|
||||
#define __NR_nanosleep 35
|
||||
#define __NR_getitimer 36
|
||||
#define __NR_alarm 37
|
||||
#define __NR_setitimer 38
|
||||
#define __NR_getpid 39
|
||||
#define __NR_sendfile 40
|
||||
#define __NR_socket 41
|
||||
#define __NR_connect 42
|
||||
#define __NR_accept 43
|
||||
#define __NR_sendto 44
|
||||
#define __NR_recvfrom 45
|
||||
#define __NR_sendmsg 46
|
||||
#define __NR_recvmsg 47
|
||||
#define __NR_shutdown 48
|
||||
#define __NR_bind 49
|
||||
#define __NR_listen 50
|
||||
#define __NR_getsockname 51
|
||||
#define __NR_getpeername 52
|
||||
#define __NR_socketpair 53
|
||||
#define __NR_setsockopt 54
|
||||
#define __NR_getsockopt 55
|
||||
#define __NR_clone 56
|
||||
#define __NR_fork 57
|
||||
#define __NR_vfork 58
|
||||
#define __NR_execve 59
|
||||
#define __NR_exit 60
|
||||
#define __NR_wait4 61
|
||||
#define __NR_kill 62
|
||||
#define __NR_uname 63
|
||||
#define __NR_semget 64
|
||||
#define __NR_semop 65
|
||||
#define __NR_semctl 66
|
||||
#define __NR_shmdt 67
|
||||
#define __NR_msgget 68
|
||||
#define __NR_msgsnd 69
|
||||
#define __NR_msgrcv 70
|
||||
#define __NR_msgctl 71
|
||||
#define __NR_fcntl 72
|
||||
#define __NR_flock 73
|
||||
#define __NR_fsync 74
|
||||
#define __NR_fdatasync 75
|
||||
#define __NR_truncate 76
|
||||
#define __NR_ftruncate 77
|
||||
#define __NR_getdents 78
|
||||
#define __NR_getcwd 79
|
||||
#define __NR_chdir 80
|
||||
#define __NR_fchdir 81
|
||||
#define __NR_rename 82
|
||||
#define __NR_mkdir 83
|
||||
#define __NR_rmdir 84
|
||||
#define __NR_creat 85
|
||||
#define __NR_link 86
|
||||
#define __NR_unlink 87
|
||||
#define __NR_symlink 88
|
||||
#define __NR_readlink 89
|
||||
#define __NR_chmod 90
|
||||
#define __NR_fchmod 91
|
||||
#define __NR_chown 92
|
||||
#define __NR_fchown 93
|
||||
#define __NR_lchown 94
|
||||
#define __NR_umask 95
|
||||
#define __NR_gettimeofday 96
|
||||
#define __NR_getrlimit 97
|
||||
#define __NR_getrusage 98
|
||||
#define __NR_sysinfo 99
|
||||
#define __NR_times 100
|
||||
#define __NR_ptrace 101
|
||||
#define __NR_getuid 102
|
||||
#define __NR_syslog 103
|
||||
#define __NR_getgid 104
|
||||
#define __NR_setuid 105
|
||||
#define __NR_setgid 106
|
||||
#define __NR_geteuid 107
|
||||
#define __NR_getegid 108
|
||||
#define __NR_setpgid 109
|
||||
#define __NR_getppid 110
|
||||
#define __NR_getpgrp 111
|
||||
#define __NR_setsid 112
|
||||
#define __NR_setreuid 113
|
||||
#define __NR_setregid 114
|
||||
#define __NR_getgroups 115
|
||||
#define __NR_setgroups 116
|
||||
#define __NR_setresuid 117
|
||||
#define __NR_getresuid 118
|
||||
#define __NR_setresgid 119
|
||||
#define __NR_getresgid 120
|
||||
#define __NR_getpgid 121
|
||||
#define __NR_setfsuid 122
|
||||
#define __NR_setfsgid 123
|
||||
#define __NR_getsid 124
|
||||
#define __NR_capget 125
|
||||
#define __NR_capset 126
|
||||
#define __NR_rt_sigpending 127
|
||||
#define __NR_rt_sigtimedwait 128
|
||||
#define __NR_rt_sigqueueinfo 129
|
||||
#define __NR_rt_sigsuspend 130
|
||||
#define __NR_sigaltstack 131
|
||||
#define __NR_utime 132
|
||||
#define __NR_mknod 133
|
||||
#define __NR_uselib 134
|
||||
#define __NR_personality 135
|
||||
#define __NR_ustat 136
|
||||
#define __NR_statfs 137
|
||||
#define __NR_fstatfs 138
|
||||
#define __NR_sysfs 139
|
||||
#define __NR_getpriority 140
|
||||
#define __NR_setpriority 141
|
||||
#define __NR_sched_setparam 142
|
||||
#define __NR_sched_getparam 143
|
||||
#define __NR_sched_setscheduler 144
|
||||
#define __NR_sched_getscheduler 145
|
||||
#define __NR_sched_get_priority_max 146
|
||||
#define __NR_sched_get_priority_min 147
|
||||
#define __NR_sched_rr_get_interval 148
|
||||
#define __NR_mlock 149
|
||||
#define __NR_munlock 150
|
||||
#define __NR_mlockall 151
|
||||
#define __NR_munlockall 152
|
||||
#define __NR_vhangup 153
|
||||
#define __NR_modify_ldt 154
|
||||
#define __NR_pivot_root 155
|
||||
#define __NR__sysctl 156
|
||||
#define __NR_prctl 157
|
||||
#define __NR_arch_prctl 158
|
||||
#define __NR_adjtimex 159
|
||||
#define __NR_setrlimit 160
|
||||
#define __NR_chroot 161
|
||||
#define __NR_sync 162
|
||||
#define __NR_acct 163
|
||||
#define __NR_settimeofday 164
|
||||
#define __NR_mount 165
|
||||
#define __NR_umount2 166
|
||||
#define __NR_swapon 167
|
||||
#define __NR_swapoff 168
|
||||
#define __NR_reboot 169
|
||||
#define __NR_sethostname 170
|
||||
#define __NR_setdomainname 171
|
||||
#define __NR_iopl 172
|
||||
#define __NR_ioperm 173
|
||||
#define __NR_create_module 174
|
||||
#define __NR_init_module 175
|
||||
#define __NR_delete_module 176
|
||||
#define __NR_get_kernel_syms 177
|
||||
#define __NR_query_module 178
|
||||
#define __NR_quotactl 179
|
||||
#define __NR_nfsservctl 180
|
||||
#define __NR_getpmsg 181
|
||||
#define __NR_putpmsg 182
|
||||
#define __NR_afs_syscall 183
|
||||
#define __NR_tuxcall 184
|
||||
#define __NR_security 185
|
||||
#define __NR_gettid 186
|
||||
#define __NR_readahead 187
|
||||
#define __NR_setxattr 188
|
||||
#define __NR_lsetxattr 189
|
||||
#define __NR_fsetxattr 190
|
||||
#define __NR_getxattr 191
|
||||
#define __NR_lgetxattr 192
|
||||
#define __NR_fgetxattr 193
|
||||
#define __NR_listxattr 194
|
||||
#define __NR_llistxattr 195
|
||||
#define __NR_flistxattr 196
|
||||
#define __NR_removexattr 197
|
||||
#define __NR_lremovexattr 198
|
||||
#define __NR_fremovexattr 199
|
||||
#define __NR_tkill 200
|
||||
#define __NR_time 201
|
||||
#define __NR_futex 202
|
||||
#define __NR_sched_setaffinity 203
|
||||
#define __NR_sched_getaffinity 204
|
||||
#define __NR_set_thread_area 205
|
||||
#define __NR_io_setup 206
|
||||
#define __NR_io_destroy 207
|
||||
#define __NR_io_getevents 208
|
||||
#define __NR_io_submit 209
|
||||
#define __NR_io_cancel 210
|
||||
#define __NR_get_thread_area 211
|
||||
#define __NR_lookup_dcookie 212
|
||||
#define __NR_epoll_create 213
|
||||
#define __NR_epoll_ctl_old 214
|
||||
#define __NR_epoll_wait_old 215
|
||||
#define __NR_remap_file_pages 216
|
||||
#define __NR_getdents64 217
|
||||
#define __NR_set_tid_address 218
|
||||
#define __NR_restart_syscall 219
|
||||
#define __NR_semtimedop 220
|
||||
#define __NR_fadvise64 221
|
||||
#define __NR_timer_create 222
|
||||
#define __NR_timer_settime 223
|
||||
#define __NR_timer_gettime 224
|
||||
#define __NR_timer_getoverrun 225
|
||||
#define __NR_timer_delete 226
|
||||
#define __NR_clock_settime 227
|
||||
#define __NR_clock_gettime 228
|
||||
#define __NR_clock_getres 229
|
||||
#define __NR_clock_nanosleep 230
|
||||
#define __NR_exit_group 231
|
||||
#define __NR_epoll_wait 232
|
||||
#define __NR_epoll_ctl 233
|
||||
#define __NR_tgkill 234
|
||||
#define __NR_utimes 235
|
||||
#define __NR_vserver 236
|
||||
#define __NR_mbind 237
|
||||
#define __NR_set_mempolicy 238
|
||||
#define __NR_get_mempolicy 239
|
||||
#define __NR_mq_open 240
|
||||
#define __NR_mq_unlink 241
|
||||
#define __NR_mq_timedsend 242
|
||||
#define __NR_mq_timedreceive 243
|
||||
#define __NR_mq_notify 244
|
||||
#define __NR_mq_getsetattr 245
|
||||
#define __NR_kexec_load 246
|
||||
#define __NR_waitid 247
|
||||
#define __NR_add_key 248
|
||||
#define __NR_request_key 249
|
||||
#define __NR_keyctl 250
|
||||
#define __NR_ioprio_set 251
|
||||
#define __NR_ioprio_get 252
|
||||
#define __NR_inotify_init 253
|
||||
#define __NR_inotify_add_watch 254
|
||||
#define __NR_inotify_rm_watch 255
|
||||
#define __NR_migrate_pages 256
|
||||
#define __NR_openat 257
|
||||
#define __NR_mkdirat 258
|
||||
#define __NR_mknodat 259
|
||||
#define __NR_fchownat 260
|
||||
#define __NR_futimesat 261
|
||||
#define __NR_newfstatat 262
|
||||
#define __NR_unlinkat 263
|
||||
#define __NR_renameat 264
|
||||
#define __NR_linkat 265
|
||||
#define __NR_symlinkat 266
|
||||
#define __NR_readlinkat 267
|
||||
#define __NR_fchmodat 268
|
||||
#define __NR_faccessat 269
|
||||
#define __NR_pselect6 270
|
||||
#define __NR_ppoll 271
|
||||
#define __NR_unshare 272
|
||||
#define __NR_set_robust_list 273
|
||||
#define __NR_get_robust_list 274
|
||||
#define __NR_splice 275
|
||||
#define __NR_tee 276
|
||||
#define __NR_sync_file_range 277
|
||||
#define __NR_vmsplice 278
|
||||
#define __NR_move_pages 279
|
||||
#define __NR_utimensat 280
|
||||
#define __NR_epoll_pwait 281
|
||||
#define __NR_signalfd 282
|
||||
#define __NR_timerfd_create 283
|
||||
#define __NR_eventfd 284
|
||||
#define __NR_fallocate 285
|
||||
#define __NR_timerfd_settime 286
|
||||
#define __NR_timerfd_gettime 287
|
||||
#define __NR_accept4 288
|
||||
#define __NR_signalfd4 289
|
||||
#define __NR_eventfd2 290
|
||||
#define __NR_epoll_create1 291
|
||||
#define __NR_dup3 292
|
||||
#define __NR_pipe2 293
|
||||
#define __NR_inotify_init1 294
|
||||
#define __NR_preadv 295
|
||||
#define __NR_pwritev 296
|
||||
#define __NR_rt_tgsigqueueinfo 297
|
||||
#define __NR_perf_event_open 298
|
||||
#define __NR_recvmmsg 299
|
||||
#define __NR_fanotify_init 300
|
||||
#define __NR_fanotify_mark 301
|
||||
#define __NR_prlimit64 302
|
||||
#define __NR_name_to_handle_at 303
|
||||
#define __NR_open_by_handle_at 304
|
||||
#define __NR_clock_adjtime 305
|
||||
#define __NR_syncfs 306
|
||||
#define __NR_sendmmsg 307
|
||||
#define __NR_setns 308
|
||||
#define __NR_getcpu 309
|
||||
#define __NR_process_vm_readv 310
|
||||
#define __NR_process_vm_writev 311
|
||||
#define __NR_kcmp 312
|
||||
#define __NR_finit_module 313
|
||||
#define __NR_sched_setattr 314
|
||||
#define __NR_sched_getattr 315
|
||||
#define __NR_renameat2 316
|
||||
#define __NR_seccomp 317
|
||||
#define __NR_getrandom 318
|
||||
#define __NR_memfd_create 319
|
||||
#define __NR_kexec_file_load 320
|
||||
#define __NR_bpf 321
|
||||
#define __NR_execveat 322
|
||||
#define __NR_userfaultfd 323
|
||||
#define __NR_membarrier 324
|
||||
#define __NR_mlock2 325
|
||||
#define __NR_copy_file_range 326
|
||||
#define __NR_preadv2 327
|
||||
#define __NR_pwritev2 328
|
||||
#define __NR_pkey_mprotect 329
|
||||
#define __NR_pkey_alloc 330
|
||||
#define __NR_pkey_free 331
|
||||
#define __NR_statx 332
|
||||
#define __NR_io_pgetevents 333
|
||||
#define __NR_rseq 334
|
||||
#define __NR_pidfd_send_signal 424
|
||||
#define __NR_io_uring_setup 425
|
||||
#define __NR_io_uring_enter 426
|
||||
#define __NR_io_uring_register 427
|
||||
#define __NR_open_tree 428
|
||||
#define __NR_move_mount 429
|
||||
#define __NR_fsopen 430
|
||||
#define __NR_fsconfig 431
|
||||
#define __NR_fsmount 432
|
||||
#define __NR_fspick 433
|
||||
#define __NR_pidfd_open 434
|
||||
#define __NR_clone3 435
|
||||
#define __NR_close_range 436
|
||||
#define __NR_openat2 437
|
||||
#define __NR_pidfd_getfd 438
|
||||
#define __NR_faccessat2 439
|
||||
#define __NR_process_madvise 440
|
||||
#define __NR_epoll_pwait2 441
|
||||
#define __NR_mount_setattr 442
|
||||
#define __NR_landlock_create_ruleset 444
|
||||
#define __NR_landlock_add_rule 445
|
||||
#define __NR_landlock_restrict_self 446
|
||||
#define __NR_memfd_secret 447
|
||||
#define __NR_process_mrelease 448
|
||||
#define __NR_futex_waitv 449
|
||||
#define __NR_set_mempolicy_home_node 450
|
||||
#define __NR_cachestat 451
|
||||
#define __NR_fchmodat2 452
|
||||
|
||||
#define SYS_read 0
|
||||
#define SYS_write 1
|
||||
#define SYS_open 2
|
||||
#define SYS_close 3
|
||||
#define SYS_stat 4
|
||||
#define SYS_fstat 5
|
||||
#define SYS_lstat 6
|
||||
#define SYS_poll 7
|
||||
#define SYS_lseek 8
|
||||
#define SYS_mmap 9
|
||||
#define SYS_mprotect 10
|
||||
#define SYS_munmap 11
|
||||
#define SYS_brk 12
|
||||
#define SYS_rt_sigaction 13
|
||||
#define SYS_rt_sigprocmask 14
|
||||
#define SYS_rt_sigreturn 15
|
||||
#define SYS_ioctl 16
|
||||
#define SYS_pread64 17
|
||||
#define SYS_pwrite64 18
|
||||
#define SYS_readv 19
|
||||
#define SYS_writev 20
|
||||
#define SYS_access 21
|
||||
#define SYS_pipe 22
|
||||
#define SYS_select 23
|
||||
#define SYS_sched_yield 24
|
||||
#define SYS_mremap 25
|
||||
#define SYS_msync 26
|
||||
#define SYS_mincore 27
|
||||
#define SYS_madvise 28
|
||||
#define SYS_shmget 29
|
||||
#define SYS_shmat 30
|
||||
#define SYS_shmctl 31
|
||||
#define SYS_dup 32
|
||||
#define SYS_dup2 33
|
||||
#define SYS_pause 34
|
||||
#define SYS_nanosleep 35
|
||||
#define SYS_getitimer 36
|
||||
#define SYS_alarm 37
|
||||
#define SYS_setitimer 38
|
||||
#define SYS_getpid 39
|
||||
#define SYS_sendfile 40
|
||||
#define SYS_socket 41
|
||||
#define SYS_connect 42
|
||||
#define SYS_accept 43
|
||||
#define SYS_sendto 44
|
||||
#define SYS_recvfrom 45
|
||||
#define SYS_sendmsg 46
|
||||
#define SYS_recvmsg 47
|
||||
#define SYS_shutdown 48
|
||||
#define SYS_bind 49
|
||||
#define SYS_listen 50
|
||||
#define SYS_getsockname 51
|
||||
#define SYS_getpeername 52
|
||||
#define SYS_socketpair 53
|
||||
#define SYS_setsockopt 54
|
||||
#define SYS_getsockopt 55
|
||||
#define SYS_clone 56
|
||||
#define SYS_fork 57
|
||||
#define SYS_vfork 58
|
||||
#define SYS_execve 59
|
||||
#define SYS_exit 60
|
||||
#define SYS_wait4 61
|
||||
#define SYS_kill 62
|
||||
#define SYS_uname 63
|
||||
#define SYS_semget 64
|
||||
#define SYS_semop 65
|
||||
#define SYS_semctl 66
|
||||
#define SYS_shmdt 67
|
||||
#define SYS_msgget 68
|
||||
#define SYS_msgsnd 69
|
||||
#define SYS_msgrcv 70
|
||||
#define SYS_msgctl 71
|
||||
#define SYS_fcntl 72
|
||||
#define SYS_flock 73
|
||||
#define SYS_fsync 74
|
||||
#define SYS_fdatasync 75
|
||||
#define SYS_truncate 76
|
||||
#define SYS_ftruncate 77
|
||||
#define SYS_getdents 78
|
||||
#define SYS_getcwd 79
|
||||
#define SYS_chdir 80
|
||||
#define SYS_fchdir 81
|
||||
#define SYS_rename 82
|
||||
#define SYS_mkdir 83
|
||||
#define SYS_rmdir 84
|
||||
#define SYS_creat 85
|
||||
#define SYS_link 86
|
||||
#define SYS_unlink 87
|
||||
#define SYS_symlink 88
|
||||
#define SYS_readlink 89
|
||||
#define SYS_chmod 90
|
||||
#define SYS_fchmod 91
|
||||
#define SYS_chown 92
|
||||
#define SYS_fchown 93
|
||||
#define SYS_lchown 94
|
||||
#define SYS_umask 95
|
||||
#define SYS_gettimeofday 96
|
||||
#define SYS_getrlimit 97
|
||||
#define SYS_getrusage 98
|
||||
#define SYS_sysinfo 99
|
||||
#define SYS_times 100
|
||||
#define SYS_ptrace 101
|
||||
#define SYS_getuid 102
|
||||
#define SYS_syslog 103
|
||||
#define SYS_getgid 104
|
||||
#define SYS_setuid 105
|
||||
#define SYS_setgid 106
|
||||
#define SYS_geteuid 107
|
||||
#define SYS_getegid 108
|
||||
#define SYS_setpgid 109
|
||||
#define SYS_getppid 110
|
||||
#define SYS_getpgrp 111
|
||||
#define SYS_setsid 112
|
||||
#define SYS_setreuid 113
|
||||
#define SYS_setregid 114
|
||||
#define SYS_getgroups 115
|
||||
#define SYS_setgroups 116
|
||||
#define SYS_setresuid 117
|
||||
#define SYS_getresuid 118
|
||||
#define SYS_setresgid 119
|
||||
#define SYS_getresgid 120
|
||||
#define SYS_getpgid 121
|
||||
#define SYS_setfsuid 122
|
||||
#define SYS_setfsgid 123
|
||||
#define SYS_getsid 124
|
||||
#define SYS_capget 125
|
||||
#define SYS_capset 126
|
||||
#define SYS_rt_sigpending 127
|
||||
#define SYS_rt_sigtimedwait 128
|
||||
#define SYS_rt_sigqueueinfo 129
|
||||
#define SYS_rt_sigsuspend 130
|
||||
#define SYS_sigaltstack 131
|
||||
#define SYS_utime 132
|
||||
#define SYS_mknod 133
|
||||
#define SYS_uselib 134
|
||||
#define SYS_personality 135
|
||||
#define SYS_ustat 136
|
||||
#define SYS_statfs 137
|
||||
#define SYS_fstatfs 138
|
||||
#define SYS_sysfs 139
|
||||
#define SYS_getpriority 140
|
||||
#define SYS_setpriority 141
|
||||
#define SYS_sched_setparam 142
|
||||
#define SYS_sched_getparam 143
|
||||
#define SYS_sched_setscheduler 144
|
||||
#define SYS_sched_getscheduler 145
|
||||
#define SYS_sched_get_priority_max 146
|
||||
#define SYS_sched_get_priority_min 147
|
||||
#define SYS_sched_rr_get_interval 148
|
||||
#define SYS_mlock 149
|
||||
#define SYS_munlock 150
|
||||
#define SYS_mlockall 151
|
||||
#define SYS_munlockall 152
|
||||
#define SYS_vhangup 153
|
||||
#define SYS_modify_ldt 154
|
||||
#define SYS_pivot_root 155
|
||||
#define SYS__sysctl 156
|
||||
#define SYS_prctl 157
|
||||
#define SYS_arch_prctl 158
|
||||
#define SYS_adjtimex 159
|
||||
#define SYS_setrlimit 160
|
||||
#define SYS_chroot 161
|
||||
#define SYS_sync 162
|
||||
#define SYS_acct 163
|
||||
#define SYS_settimeofday 164
|
||||
#define SYS_mount 165
|
||||
#define SYS_umount2 166
|
||||
#define SYS_swapon 167
|
||||
#define SYS_swapoff 168
|
||||
#define SYS_reboot 169
|
||||
#define SYS_sethostname 170
|
||||
#define SYS_setdomainname 171
|
||||
#define SYS_iopl 172
|
||||
#define SYS_ioperm 173
|
||||
#define SYS_create_module 174
|
||||
#define SYS_init_module 175
|
||||
#define SYS_delete_module 176
|
||||
#define SYS_get_kernel_syms 177
|
||||
#define SYS_query_module 178
|
||||
#define SYS_quotactl 179
|
||||
#define SYS_nfsservctl 180
|
||||
#define SYS_getpmsg 181
|
||||
#define SYS_putpmsg 182
|
||||
#define SYS_afs_syscall 183
|
||||
#define SYS_tuxcall 184
|
||||
#define SYS_security 185
|
||||
#define SYS_gettid 186
|
||||
#define SYS_readahead 187
|
||||
#define SYS_setxattr 188
|
||||
#define SYS_lsetxattr 189
|
||||
#define SYS_fsetxattr 190
|
||||
#define SYS_getxattr 191
|
||||
#define SYS_lgetxattr 192
|
||||
#define SYS_fgetxattr 193
|
||||
#define SYS_listxattr 194
|
||||
#define SYS_llistxattr 195
|
||||
#define SYS_flistxattr 196
|
||||
#define SYS_removexattr 197
|
||||
#define SYS_lremovexattr 198
|
||||
#define SYS_fremovexattr 199
|
||||
#define SYS_tkill 200
|
||||
#define SYS_time 201
|
||||
#define SYS_futex 202
|
||||
#define SYS_sched_setaffinity 203
|
||||
#define SYS_sched_getaffinity 204
|
||||
#define SYS_set_thread_area 205
|
||||
#define SYS_io_setup 206
|
||||
#define SYS_io_destroy 207
|
||||
#define SYS_io_getevents 208
|
||||
#define SYS_io_submit 209
|
||||
#define SYS_io_cancel 210
|
||||
#define SYS_get_thread_area 211
|
||||
#define SYS_lookup_dcookie 212
|
||||
#define SYS_epoll_create 213
|
||||
#define SYS_epoll_ctl_old 214
|
||||
#define SYS_epoll_wait_old 215
|
||||
#define SYS_remap_file_pages 216
|
||||
#define SYS_getdents64 217
|
||||
#define SYS_set_tid_address 218
|
||||
#define SYS_restart_syscall 219
|
||||
#define SYS_semtimedop 220
|
||||
#define SYS_fadvise64 221
|
||||
#define SYS_timer_create 222
|
||||
#define SYS_timer_settime 223
|
||||
#define SYS_timer_gettime 224
|
||||
#define SYS_timer_getoverrun 225
|
||||
#define SYS_timer_delete 226
|
||||
#define SYS_clock_settime 227
|
||||
#define SYS_clock_gettime 228
|
||||
#define SYS_clock_getres 229
|
||||
#define SYS_clock_nanosleep 230
|
||||
#define SYS_exit_group 231
|
||||
#define SYS_epoll_wait 232
|
||||
#define SYS_epoll_ctl 233
|
||||
#define SYS_tgkill 234
|
||||
#define SYS_utimes 235
|
||||
#define SYS_vserver 236
|
||||
#define SYS_mbind 237
|
||||
#define SYS_set_mempolicy 238
|
||||
#define SYS_get_mempolicy 239
|
||||
#define SYS_mq_open 240
|
||||
#define SYS_mq_unlink 241
|
||||
#define SYS_mq_timedsend 242
|
||||
#define SYS_mq_timedreceive 243
|
||||
#define SYS_mq_notify 244
|
||||
#define SYS_mq_getsetattr 245
|
||||
#define SYS_kexec_load 246
|
||||
#define SYS_waitid 247
|
||||
#define SYS_add_key 248
|
||||
#define SYS_request_key 249
|
||||
#define SYS_keyctl 250
|
||||
#define SYS_ioprio_set 251
|
||||
#define SYS_ioprio_get 252
|
||||
#define SYS_inotify_init 253
|
||||
#define SYS_inotify_add_watch 254
|
||||
#define SYS_inotify_rm_watch 255
|
||||
#define SYS_migrate_pages 256
|
||||
#define SYS_openat 257
|
||||
#define SYS_mkdirat 258
|
||||
#define SYS_mknodat 259
|
||||
#define SYS_fchownat 260
|
||||
#define SYS_futimesat 261
|
||||
#define SYS_newfstatat 262
|
||||
#define SYS_unlinkat 263
|
||||
#define SYS_renameat 264
|
||||
#define SYS_linkat 265
|
||||
#define SYS_symlinkat 266
|
||||
#define SYS_readlinkat 267
|
||||
#define SYS_fchmodat 268
|
||||
#define SYS_faccessat 269
|
||||
#define SYS_pselect6 270
|
||||
#define SYS_ppoll 271
|
||||
#define SYS_unshare 272
|
||||
#define SYS_set_robust_list 273
|
||||
#define SYS_get_robust_list 274
|
||||
#define SYS_splice 275
|
||||
#define SYS_tee 276
|
||||
#define SYS_sync_file_range 277
|
||||
#define SYS_vmsplice 278
|
||||
#define SYS_move_pages 279
|
||||
#define SYS_utimensat 280
|
||||
#define SYS_epoll_pwait 281
|
||||
#define SYS_signalfd 282
|
||||
#define SYS_timerfd_create 283
|
||||
#define SYS_eventfd 284
|
||||
#define SYS_fallocate 285
|
||||
#define SYS_timerfd_settime 286
|
||||
#define SYS_timerfd_gettime 287
|
||||
#define SYS_accept4 288
|
||||
#define SYS_signalfd4 289
|
||||
#define SYS_eventfd2 290
|
||||
#define SYS_epoll_create1 291
|
||||
#define SYS_dup3 292
|
||||
#define SYS_pipe2 293
|
||||
#define SYS_inotify_init1 294
|
||||
#define SYS_preadv 295
|
||||
#define SYS_pwritev 296
|
||||
#define SYS_rt_tgsigqueueinfo 297
|
||||
#define SYS_perf_event_open 298
|
||||
#define SYS_recvmmsg 299
|
||||
#define SYS_fanotify_init 300
|
||||
#define SYS_fanotify_mark 301
|
||||
#define SYS_prlimit64 302
|
||||
#define SYS_name_to_handle_at 303
|
||||
#define SYS_open_by_handle_at 304
|
||||
#define SYS_clock_adjtime 305
|
||||
#define SYS_syncfs 306
|
||||
#define SYS_sendmmsg 307
|
||||
#define SYS_setns 308
|
||||
#define SYS_getcpu 309
|
||||
#define SYS_process_vm_readv 310
|
||||
#define SYS_process_vm_writev 311
|
||||
#define SYS_kcmp 312
|
||||
#define SYS_finit_module 313
|
||||
#define SYS_sched_setattr 314
|
||||
#define SYS_sched_getattr 315
|
||||
#define SYS_renameat2 316
|
||||
#define SYS_seccomp 317
|
||||
#define SYS_getrandom 318
|
||||
#define SYS_memfd_create 319
|
||||
#define SYS_kexec_file_load 320
|
||||
#define SYS_bpf 321
|
||||
#define SYS_execveat 322
|
||||
#define SYS_userfaultfd 323
|
||||
#define SYS_membarrier 324
|
||||
#define SYS_mlock2 325
|
||||
#define SYS_copy_file_range 326
|
||||
#define SYS_preadv2 327
|
||||
#define SYS_pwritev2 328
|
||||
#define SYS_pkey_mprotect 329
|
||||
#define SYS_pkey_alloc 330
|
||||
#define SYS_pkey_free 331
|
||||
#define SYS_statx 332
|
||||
#define SYS_io_pgetevents 333
|
||||
#define SYS_rseq 334
|
||||
#define SYS_pidfd_send_signal 424
|
||||
#define SYS_io_uring_setup 425
|
||||
#define SYS_io_uring_enter 426
|
||||
#define SYS_io_uring_register 427
|
||||
#define SYS_open_tree 428
|
||||
#define SYS_move_mount 429
|
||||
#define SYS_fsopen 430
|
||||
#define SYS_fsconfig 431
|
||||
#define SYS_fsmount 432
|
||||
#define SYS_fspick 433
|
||||
#define SYS_pidfd_open 434
|
||||
#define SYS_clone3 435
|
||||
#define SYS_close_range 436
|
||||
#define SYS_openat2 437
|
||||
#define SYS_pidfd_getfd 438
|
||||
#define SYS_faccessat2 439
|
||||
#define SYS_process_madvise 440
|
||||
#define SYS_epoll_pwait2 441
|
||||
#define SYS_mount_setattr 442
|
||||
#define SYS_landlock_create_ruleset 444
|
||||
#define SYS_landlock_add_rule 445
|
||||
#define SYS_landlock_restrict_self 446
|
||||
#define SYS_memfd_secret 447
|
||||
#define SYS_process_mrelease 448
|
||||
#define SYS_futex_waitv 449
|
||||
#define SYS_set_mempolicy_home_node 450
|
||||
#define SYS_cachestat 451
|
||||
#define SYS_fchmodat2 452
|
||||
@@ -0,0 +1,41 @@
|
||||
#undef __WORDSIZE
|
||||
#define __WORDSIZE 64
|
||||
|
||||
typedef struct user_fpregs_struct {
|
||||
uint16_t cwd, swd, ftw, fop;
|
||||
uint64_t rip, rdp;
|
||||
uint32_t mxcsr, mxcr_mask;
|
||||
uint32_t st_space[32], xmm_space[64], padding[24];
|
||||
} elf_fpregset_t;
|
||||
|
||||
struct user_regs_struct {
|
||||
unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
|
||||
unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
|
||||
unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
|
||||
};
|
||||
#define ELF_NGREG 27
|
||||
typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
|
||||
|
||||
struct user {
|
||||
struct user_regs_struct regs;
|
||||
int u_fpvalid;
|
||||
struct user_fpregs_struct i387;
|
||||
unsigned long u_tsize;
|
||||
unsigned long u_dsize;
|
||||
unsigned long u_ssize;
|
||||
unsigned long start_code;
|
||||
unsigned long start_stack;
|
||||
long signal;
|
||||
int reserved;
|
||||
struct user_regs_struct *u_ar0;
|
||||
struct user_fpregs_struct *u_fpstate;
|
||||
unsigned long magic;
|
||||
char u_comm[32];
|
||||
unsigned long u_debugreg[8];
|
||||
};
|
||||
|
||||
#define PAGE_MASK (~(PAGESIZE-1))
|
||||
#define NBPG PAGESIZE
|
||||
#define UPAGES 1
|
||||
#define HOST_TEXT_START_ADDR (u.start_code)
|
||||
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
|
||||
@@ -0,0 +1,423 @@
|
||||
#define _Addr int
|
||||
#define _Int64 long long
|
||||
#define _Reg long long
|
||||
|
||||
#define __BYTE_ORDER 1234
|
||||
#define __LONG_MAX 0x7fffffffL
|
||||
|
||||
#ifndef __cplusplus
|
||||
#ifdef __WCHAR_TYPE__
|
||||
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
|
||||
typedef __WCHAR_TYPE__ wchar_t;
|
||||
#define __DEFINED_wchar_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
|
||||
typedef long wchar_t;
|
||||
#define __DEFINED_wchar_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
|
||||
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
|
||||
typedef long double float_t;
|
||||
#define __DEFINED_float_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
|
||||
typedef long double double_t;
|
||||
#define __DEFINED_double_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
|
||||
typedef float float_t;
|
||||
#define __DEFINED_float_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
|
||||
typedef double double_t;
|
||||
#define __DEFINED_double_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
|
||||
typedef struct { long long __ll; long double __ld; } max_align_t;
|
||||
#define __DEFINED_max_align_t
|
||||
#endif
|
||||
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#define __BIG_ENDIAN 4321
|
||||
#define __USE_TIME_BITS64 1
|
||||
|
||||
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
|
||||
typedef unsigned _Addr size_t;
|
||||
#define __DEFINED_size_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
|
||||
typedef unsigned _Addr uintptr_t;
|
||||
#define __DEFINED_uintptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
|
||||
typedef _Addr ptrdiff_t;
|
||||
#define __DEFINED_ptrdiff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
|
||||
typedef _Addr ssize_t;
|
||||
#define __DEFINED_ssize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
|
||||
typedef _Addr intptr_t;
|
||||
#define __DEFINED_intptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
|
||||
typedef _Addr regoff_t;
|
||||
#define __DEFINED_regoff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
|
||||
typedef _Reg register_t;
|
||||
#define __DEFINED_register_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
|
||||
typedef _Int64 time_t;
|
||||
#define __DEFINED_time_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
|
||||
typedef _Int64 suseconds_t;
|
||||
#define __DEFINED_suseconds_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
|
||||
typedef signed char int8_t;
|
||||
#define __DEFINED_int8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
|
||||
typedef signed short int16_t;
|
||||
#define __DEFINED_int16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
|
||||
typedef signed int int32_t;
|
||||
#define __DEFINED_int32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
|
||||
typedef signed _Int64 int64_t;
|
||||
#define __DEFINED_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
|
||||
typedef signed _Int64 intmax_t;
|
||||
#define __DEFINED_intmax_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
|
||||
typedef unsigned char uint8_t;
|
||||
#define __DEFINED_uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
|
||||
typedef unsigned short uint16_t;
|
||||
#define __DEFINED_uint16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
|
||||
typedef unsigned int uint32_t;
|
||||
#define __DEFINED_uint32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
|
||||
typedef unsigned _Int64 uint64_t;
|
||||
#define __DEFINED_uint64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
|
||||
typedef unsigned _Int64 u_int64_t;
|
||||
#define __DEFINED_u_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
|
||||
typedef unsigned _Int64 uintmax_t;
|
||||
#define __DEFINED_uintmax_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
|
||||
typedef unsigned mode_t;
|
||||
#define __DEFINED_mode_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
|
||||
typedef unsigned _Reg nlink_t;
|
||||
#define __DEFINED_nlink_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
|
||||
typedef _Int64 off_t;
|
||||
#define __DEFINED_off_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
|
||||
typedef unsigned _Int64 ino_t;
|
||||
#define __DEFINED_ino_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
|
||||
typedef unsigned _Int64 dev_t;
|
||||
#define __DEFINED_dev_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
|
||||
typedef long blksize_t;
|
||||
#define __DEFINED_blksize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
|
||||
typedef _Int64 blkcnt_t;
|
||||
#define __DEFINED_blkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
|
||||
typedef unsigned _Int64 fsblkcnt_t;
|
||||
#define __DEFINED_fsblkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
|
||||
typedef unsigned _Int64 fsfilcnt_t;
|
||||
#define __DEFINED_fsfilcnt_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
|
||||
typedef unsigned wint_t;
|
||||
#define __DEFINED_wint_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
|
||||
typedef unsigned long wctype_t;
|
||||
#define __DEFINED_wctype_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
|
||||
typedef void * timer_t;
|
||||
#define __DEFINED_timer_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
|
||||
typedef int clockid_t;
|
||||
#define __DEFINED_clockid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
|
||||
typedef long clock_t;
|
||||
#define __DEFINED_clock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
|
||||
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
|
||||
#define __DEFINED_struct_timeval
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
|
||||
struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
|
||||
#define __DEFINED_struct_timespec
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
|
||||
typedef int pid_t;
|
||||
#define __DEFINED_pid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
|
||||
typedef unsigned id_t;
|
||||
#define __DEFINED_id_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
|
||||
typedef unsigned uid_t;
|
||||
#define __DEFINED_uid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
|
||||
typedef unsigned gid_t;
|
||||
#define __DEFINED_gid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
|
||||
typedef int key_t;
|
||||
#define __DEFINED_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
|
||||
typedef unsigned useconds_t;
|
||||
#define __DEFINED_useconds_t
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef unsigned long pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef struct __pthread * pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
|
||||
typedef int pthread_once_t;
|
||||
#define __DEFINED_pthread_once_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
|
||||
typedef unsigned pthread_key_t;
|
||||
#define __DEFINED_pthread_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
|
||||
typedef int pthread_spinlock_t;
|
||||
#define __DEFINED_pthread_spinlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_mutexattr_t;
|
||||
#define __DEFINED_pthread_mutexattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_condattr_t;
|
||||
#define __DEFINED_pthread_condattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_barrierattr_t;
|
||||
#define __DEFINED_pthread_barrierattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
|
||||
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
|
||||
#define __DEFINED_pthread_rwlockattr_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE)
|
||||
struct _IO_FILE { char __x; };
|
||||
#define __DEFINED_struct__IO_FILE
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
|
||||
typedef struct _IO_FILE FILE;
|
||||
#define __DEFINED_FILE
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
|
||||
typedef __builtin_va_list va_list;
|
||||
#define __DEFINED_va_list
|
||||
#endif
|
||||
|
||||
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
|
||||
typedef __builtin_va_list __isoc_va_list;
|
||||
#define __DEFINED___isoc_va_list
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
|
||||
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
|
||||
#define __DEFINED_mbstate_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
|
||||
typedef struct __locale_struct * locale_t;
|
||||
#define __DEFINED_locale_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
|
||||
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
|
||||
#define __DEFINED_sigset_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
|
||||
struct iovec { void *iov_base; size_t iov_len; };
|
||||
#define __DEFINED_struct_iovec
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
|
||||
struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
|
||||
#define __DEFINED_struct_winsize
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
|
||||
typedef unsigned socklen_t;
|
||||
#define __DEFINED_socklen_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
|
||||
typedef unsigned short sa_family_t;
|
||||
#define __DEFINED_sa_family_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
|
||||
#define __DEFINED_pthread_attr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
|
||||
#define __DEFINED_pthread_mutex_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
|
||||
#define __DEFINED_mtx_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
|
||||
#define __DEFINED_pthread_cond_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
|
||||
#define __DEFINED_cnd_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
|
||||
#define __DEFINED_pthread_rwlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
|
||||
#define __DEFINED_pthread_barrier_t
|
||||
#endif
|
||||
|
||||
|
||||
#undef _Addr
|
||||
#undef _Int64
|
||||
#undef _Reg
|
||||
@@ -0,0 +1,40 @@
|
||||
#define O_CREAT 0100
|
||||
#define O_EXCL 0200
|
||||
#define O_NOCTTY 0400
|
||||
#define O_TRUNC 01000
|
||||
#define O_APPEND 02000
|
||||
#define O_NONBLOCK 04000
|
||||
#define O_DSYNC 010000
|
||||
#define O_SYNC 04010000
|
||||
#define O_RSYNC 04010000
|
||||
#define O_DIRECTORY 0200000
|
||||
#define O_NOFOLLOW 0400000
|
||||
#define O_CLOEXEC 02000000
|
||||
|
||||
#define O_ASYNC 020000
|
||||
#define O_DIRECT 040000
|
||||
#define O_LARGEFILE 0100000
|
||||
#define O_NOATIME 01000000
|
||||
#define O_PATH 010000000
|
||||
#define O_TMPFILE 020200000
|
||||
#define O_NDELAY O_NONBLOCK
|
||||
|
||||
#define F_DUPFD 0
|
||||
#define F_GETFD 1
|
||||
#define F_SETFD 2
|
||||
#define F_GETFL 3
|
||||
#define F_SETFL 4
|
||||
|
||||
#define F_SETOWN 8
|
||||
#define F_GETOWN 9
|
||||
#define F_SETSIG 10
|
||||
#define F_GETSIG 11
|
||||
|
||||
#define F_GETLK 5
|
||||
#define F_SETLK 6
|
||||
#define F_SETLKW 7
|
||||
|
||||
#define F_SETOWN_EX 15
|
||||
#define F_GETOWN_EX 16
|
||||
|
||||
#define F_GETOWNER_UIDS 17
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifdef __FLT_EVAL_METHOD__
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
#else
|
||||
#define FLT_EVAL_METHOD 0
|
||||
#endif
|
||||
|
||||
#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
|
||||
#define LDBL_MIN 3.3621031431120935063e-4932L
|
||||
#define LDBL_MAX 1.1897314953572317650e+4932L
|
||||
#define LDBL_EPSILON 1.0842021724855044340e-19L
|
||||
|
||||
#define LDBL_MANT_DIG 64
|
||||
#define LDBL_MIN_EXP (-16381)
|
||||
#define LDBL_MAX_EXP 16384
|
||||
|
||||
#define LDBL_DIG 18
|
||||
#define LDBL_MIN_10_EXP (-4931)
|
||||
#define LDBL_MAX_10_EXP 4932
|
||||
|
||||
#define DECIMAL_DIG 21
|
||||
@@ -0,0 +1,77 @@
|
||||
static __inline void outb(unsigned char __val, unsigned short __port)
|
||||
{
|
||||
__asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
|
||||
}
|
||||
|
||||
static __inline void outw(unsigned short __val, unsigned short __port)
|
||||
{
|
||||
__asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
|
||||
}
|
||||
|
||||
static __inline void outl(unsigned int __val, unsigned short __port)
|
||||
{
|
||||
__asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
|
||||
}
|
||||
|
||||
static __inline unsigned char inb(unsigned short __port)
|
||||
{
|
||||
unsigned char __val;
|
||||
__asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
|
||||
return __val;
|
||||
}
|
||||
|
||||
static __inline unsigned short inw(unsigned short __port)
|
||||
{
|
||||
unsigned short __val;
|
||||
__asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
|
||||
return __val;
|
||||
}
|
||||
|
||||
static __inline unsigned int inl(unsigned short __port)
|
||||
{
|
||||
unsigned int __val;
|
||||
__asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
|
||||
return __val;
|
||||
}
|
||||
|
||||
static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; outsb"
|
||||
: "+S" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; outsw"
|
||||
: "+S" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; outsl"
|
||||
: "+S" (__buf), "+c"(__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; insb"
|
||||
: "+D" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; insw"
|
||||
: "+D" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
|
||||
static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
|
||||
{
|
||||
__asm__ volatile ("cld; rep; insl"
|
||||
: "+D" (__buf), "+c" (__n)
|
||||
: "d" (__port));
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
#undef SIOCGSTAMP
|
||||
#undef SIOCGSTAMPNS
|
||||
#define SIOCGSTAMP 0x8906
|
||||
#define SIOCGSTAMPNS 0x8907
|
||||
@@ -0,0 +1,11 @@
|
||||
struct ipc_perm {
|
||||
key_t __ipc_perm_key;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
uid_t cuid;
|
||||
gid_t cgid;
|
||||
mode_t mode;
|
||||
int __ipc_perm_seq;
|
||||
long long __pad1;
|
||||
long long __pad2;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
#define PAGESIZE 4096
|
||||
@@ -0,0 +1 @@
|
||||
#define MAP_32BIT 0x40
|
||||
@@ -0,0 +1,15 @@
|
||||
struct msqid_ds {
|
||||
struct ipc_perm msg_perm;
|
||||
time_t msg_stime;
|
||||
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 long __unused[2];
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
#define PTRACE_GET_THREAD_AREA 25
|
||||
#define PTRACE_SET_THREAD_AREA 26
|
||||
#define PTRACE_ARCH_PRCTL 30
|
||||
#define PTRACE_SYSEMU 31
|
||||
#define PTRACE_SYSEMU_SINGLESTEP 32
|
||||
#define PTRACE_SINGLEBLOCK 33
|
||||
|
||||
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
|
||||
#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
|
||||
#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
|
||||
#define PT_SYSEMU PTRACE_SYSEMU
|
||||
#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
|
||||
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
|
||||
@@ -0,0 +1,29 @@
|
||||
#undef __WORDSIZE
|
||||
#define __WORDSIZE 32
|
||||
#define R15 0
|
||||
#define R14 1
|
||||
#define R13 2
|
||||
#define R12 3
|
||||
#define RBP 4
|
||||
#define RBX 5
|
||||
#define R11 6
|
||||
#define R10 7
|
||||
#define R9 8
|
||||
#define R8 9
|
||||
#define RAX 10
|
||||
#define RCX 11
|
||||
#define RDX 12
|
||||
#define RSI 13
|
||||
#define RDI 14
|
||||
#define ORIG_RAX 15
|
||||
#define RIP 16
|
||||
#define CS 17
|
||||
#define EFLAGS 18
|
||||
#define RSP 19
|
||||
#define SS 20
|
||||
#define FS_BASE 21
|
||||
#define GS_BASE 22
|
||||
#define DS 23
|
||||
#define ES 24
|
||||
#define FS 25
|
||||
#define GS 26
|
||||
@@ -0,0 +1,11 @@
|
||||
struct semid_ds {
|
||||
struct ipc_perm sem_perm;
|
||||
time_t sem_otime;
|
||||
long long __unused1;
|
||||
time_t sem_ctime;
|
||||
long long __unused2;
|
||||
unsigned short sem_nsems;
|
||||
char __sem_nsems_pad[sizeof(long long)-sizeof(short)];
|
||||
long long __unused3;
|
||||
long long __unused4;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
typedef unsigned long long __jmp_buf[8];
|
||||
@@ -0,0 +1,32 @@
|
||||
#define SHMLBA 4096
|
||||
|
||||
struct shmid_ds {
|
||||
struct ipc_perm shm_perm;
|
||||
size_t shm_segsz;
|
||||
time_t shm_atime;
|
||||
time_t shm_dtime;
|
||||
time_t shm_ctime;
|
||||
pid_t shm_cpid;
|
||||
pid_t shm_lpid;
|
||||
unsigned long shm_nattch;
|
||||
unsigned long __pad0;
|
||||
unsigned long long __pad1;
|
||||
unsigned long long __pad2;
|
||||
};
|
||||
|
||||
struct shminfo {
|
||||
unsigned long shmmax, __pad0, shmmin, __pad1, shmmni, __pad2,
|
||||
shmseg, __pad3, shmall, __pad4;
|
||||
unsigned long long __unused[4];
|
||||
};
|
||||
|
||||
struct shm_info {
|
||||
int __used_ids;
|
||||
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
|
||||
;
|
||||
@@ -0,0 +1,152 @@
|
||||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define MINSIGSTKSZ 2048
|
||||
#define SIGSTKSZ 8192
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
enum { REG_R8 = 0 };
|
||||
#define REG_R8 REG_R8
|
||||
enum { REG_R9 = 1 };
|
||||
#define REG_R9 REG_R9
|
||||
enum { REG_R10 = 2 };
|
||||
#define REG_R10 REG_R10
|
||||
enum { REG_R11 = 3 };
|
||||
#define REG_R11 REG_R11
|
||||
enum { REG_R12 = 4 };
|
||||
#define REG_R12 REG_R12
|
||||
enum { REG_R13 = 5 };
|
||||
#define REG_R13 REG_R13
|
||||
enum { REG_R14 = 6 };
|
||||
#define REG_R14 REG_R14
|
||||
enum { REG_R15 = 7 };
|
||||
#define REG_R15 REG_R15
|
||||
enum { REG_RDI = 8 };
|
||||
#define REG_RDI REG_RDI
|
||||
enum { REG_RSI = 9 };
|
||||
#define REG_RSI REG_RSI
|
||||
enum { REG_RBP = 10 };
|
||||
#define REG_RBP REG_RBP
|
||||
enum { REG_RBX = 11 };
|
||||
#define REG_RBX REG_RBX
|
||||
enum { REG_RDX = 12 };
|
||||
#define REG_RDX REG_RDX
|
||||
enum { REG_RAX = 13 };
|
||||
#define REG_RAX REG_RAX
|
||||
enum { REG_RCX = 14 };
|
||||
#define REG_RCX REG_RCX
|
||||
enum { REG_RSP = 15 };
|
||||
#define REG_RSP REG_RSP
|
||||
enum { REG_RIP = 16 };
|
||||
#define REG_RIP REG_RIP
|
||||
enum { REG_EFL = 17 };
|
||||
#define REG_EFL REG_EFL
|
||||
enum { REG_CSGSFS = 18 };
|
||||
#define REG_CSGSFS REG_CSGSFS
|
||||
enum { REG_ERR = 19 };
|
||||
#define REG_ERR REG_ERR
|
||||
enum { REG_TRAPNO = 20 };
|
||||
#define REG_TRAPNO REG_TRAPNO
|
||||
enum { REG_OLDMASK = 21 };
|
||||
#define REG_OLDMASK REG_OLDMASK
|
||||
enum { REG_CR2 = 22 };
|
||||
#define REG_CR2 REG_CR2
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
typedef long long greg_t, gregset_t[23];
|
||||
typedef struct _fpstate {
|
||||
unsigned short cwd, swd, ftw, fop;
|
||||
unsigned long long rip, rdp;
|
||||
unsigned mxcsr, mxcr_mask;
|
||||
struct {
|
||||
unsigned short significand[4], exponent, padding[3];
|
||||
} _st[8];
|
||||
struct {
|
||||
unsigned element[4];
|
||||
} _xmm[16];
|
||||
unsigned padding[24];
|
||||
} *fpregset_t;
|
||||
struct sigcontext {
|
||||
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 long err, trapno, oldmask, cr2;
|
||||
struct _fpstate *fpstate;
|
||||
unsigned long long __reserved1[8];
|
||||
};
|
||||
typedef struct {
|
||||
gregset_t gregs;
|
||||
fpregset_t fpregs;
|
||||
unsigned long long __reserved1[8];
|
||||
} mcontext_t;
|
||||
#else
|
||||
typedef struct {
|
||||
unsigned long long __space[32];
|
||||
} mcontext_t;
|
||||
#endif
|
||||
|
||||
struct sigaltstack {
|
||||
void *ss_sp;
|
||||
int ss_flags;
|
||||
size_t ss_size;
|
||||
};
|
||||
|
||||
typedef struct __ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct __ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
unsigned long long __fpregs_mem[64];
|
||||
} ucontext_t;
|
||||
|
||||
#define SA_NOCLDSTOP 1
|
||||
#define SA_NOCLDWAIT 2
|
||||
#define SA_SIGINFO 4
|
||||
#define SA_ONSTACK 0x08000000
|
||||
#define SA_RESTART 0x10000000
|
||||
#define SA_NODEFER 0x40000000
|
||||
#define SA_RESETHAND 0x80000000
|
||||
#define SA_RESTORER 0x04000000
|
||||
|
||||
#endif
|
||||
|
||||
#define SIGHUP 1
|
||||
#define SIGINT 2
|
||||
#define SIGQUIT 3
|
||||
#define SIGILL 4
|
||||
#define SIGTRAP 5
|
||||
#define SIGABRT 6
|
||||
#define SIGIOT SIGABRT
|
||||
#define SIGBUS 7
|
||||
#define SIGFPE 8
|
||||
#define SIGKILL 9
|
||||
#define SIGUSR1 10
|
||||
#define SIGSEGV 11
|
||||
#define SIGUSR2 12
|
||||
#define SIGPIPE 13
|
||||
#define SIGALRM 14
|
||||
#define SIGTERM 15
|
||||
#define SIGSTKFLT 16
|
||||
#define SIGCHLD 17
|
||||
#define SIGCONT 18
|
||||
#define SIGSTOP 19
|
||||
#define SIGTSTP 20
|
||||
#define SIGTTIN 21
|
||||
#define SIGTTOU 22
|
||||
#define SIGURG 23
|
||||
#define SIGXCPU 24
|
||||
#define SIGXFSZ 25
|
||||
#define SIGVTALRM 26
|
||||
#define SIGPROF 27
|
||||
#define SIGWINCH 28
|
||||
#define SIGIO 29
|
||||
#define SIGPOLL 29
|
||||
#define SIGPWR 30
|
||||
#define SIGSYS 31
|
||||
#define SIGUNUSED SIGSYS
|
||||
|
||||
#define _NSIG 65
|
||||
@@ -0,0 +1,5 @@
|
||||
#define SO_RCVTIMEO 20
|
||||
#define SO_SNDTIMEO 21
|
||||
#define SO_TIMESTAMP 29
|
||||
#define SO_TIMESTAMPNS 35
|
||||
#define SO_TIMESTAMPING 37
|
||||
@@ -0,0 +1,22 @@
|
||||
/* copied from kernel definition, but with padding replaced
|
||||
* by the corresponding correctly-sized userspace types. */
|
||||
|
||||
struct stat {
|
||||
dev_t st_dev;
|
||||
ino_t st_ino;
|
||||
nlink_t st_nlink;
|
||||
|
||||
mode_t st_mode;
|
||||
uid_t st_uid;
|
||||
gid_t st_gid;
|
||||
unsigned int __pad0;
|
||||
dev_t st_rdev;
|
||||
off_t st_size;
|
||||
blksize_t st_blksize;
|
||||
blkcnt_t st_blocks;
|
||||
|
||||
struct timespec st_atim;
|
||||
struct timespec st_mtim;
|
||||
struct timespec st_ctim;
|
||||
long long __unused[3];
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
struct statfs {
|
||||
unsigned long f_type, __pad0, f_bsize, __pad1;
|
||||
fsblkcnt_t f_blocks, f_bfree, f_bavail;
|
||||
fsfilcnt_t f_files, f_ffree;
|
||||
fsid_t f_fsid;
|
||||
unsigned long f_namelen, __pad2, f_frsize, __pad3;
|
||||
unsigned long f_flags, __pad4;
|
||||
unsigned long long f_spare[4];
|
||||
};
|
||||
@@ -0,0 +1,707 @@
|
||||
#define __NR_read (0x40000000 + 0)
|
||||
#define __NR_write (0x40000000 + 1)
|
||||
#define __NR_open (0x40000000 + 2)
|
||||
#define __NR_close (0x40000000 + 3)
|
||||
#define __NR_stat (0x40000000 + 4)
|
||||
#define __NR_fstat (0x40000000 + 5)
|
||||
#define __NR_lstat (0x40000000 + 6)
|
||||
#define __NR_poll (0x40000000 + 7)
|
||||
#define __NR_lseek (0x40000000 + 8)
|
||||
#define __NR_mmap (0x40000000 + 9)
|
||||
#define __NR_mprotect (0x40000000 + 10)
|
||||
#define __NR_munmap (0x40000000 + 11)
|
||||
#define __NR_brk (0x40000000 + 12)
|
||||
#define __NR_rt_sigprocmask (0x40000000 + 14)
|
||||
#define __NR_pread64 (0x40000000 + 17)
|
||||
#define __NR_pwrite64 (0x40000000 + 18)
|
||||
#define __NR_access (0x40000000 + 21)
|
||||
#define __NR_pipe (0x40000000 + 22)
|
||||
#define __NR_select (0x40000000 + 23)
|
||||
#define __NR_sched_yield (0x40000000 + 24)
|
||||
#define __NR_mremap (0x40000000 + 25)
|
||||
#define __NR_msync (0x40000000 + 26)
|
||||
#define __NR_mincore (0x40000000 + 27)
|
||||
#define __NR_madvise (0x40000000 + 28)
|
||||
#define __NR_shmget (0x40000000 + 29)
|
||||
#define __NR_shmat (0x40000000 + 30)
|
||||
#define __NR_shmctl (0x40000000 + 31)
|
||||
#define __NR_dup (0x40000000 + 32)
|
||||
#define __NR_dup2 (0x40000000 + 33)
|
||||
#define __NR_pause (0x40000000 + 34)
|
||||
#define __NR_nanosleep (0x40000000 + 35)
|
||||
#define __NR_getitimer (0x40000000 + 36)
|
||||
#define __NR_alarm (0x40000000 + 37)
|
||||
#define __NR_setitimer (0x40000000 + 38)
|
||||
#define __NR_getpid (0x40000000 + 39)
|
||||
#define __NR_sendfile (0x40000000 + 40)
|
||||
#define __NR_socket (0x40000000 + 41)
|
||||
#define __NR_connect (0x40000000 + 42)
|
||||
#define __NR_accept (0x40000000 + 43)
|
||||
#define __NR_sendto (0x40000000 + 44)
|
||||
#define __NR_shutdown (0x40000000 + 48)
|
||||
#define __NR_bind (0x40000000 + 49)
|
||||
#define __NR_listen (0x40000000 + 50)
|
||||
#define __NR_getsockname (0x40000000 + 51)
|
||||
#define __NR_getpeername (0x40000000 + 52)
|
||||
#define __NR_socketpair (0x40000000 + 53)
|
||||
#define __NR_clone (0x40000000 + 56)
|
||||
#define __NR_fork (0x40000000 + 57)
|
||||
#define __NR_vfork (0x40000000 + 58)
|
||||
#define __NR_exit (0x40000000 + 60)
|
||||
#define __NR_wait4 (0x40000000 + 61)
|
||||
#define __NR_kill (0x40000000 + 62)
|
||||
#define __NR_uname (0x40000000 + 63)
|
||||
#define __NR_semget (0x40000000 + 64)
|
||||
#define __NR_semop (0x40000000 + 65)
|
||||
#define __NR_semctl (0x40000000 + 66)
|
||||
#define __NR_shmdt (0x40000000 + 67)
|
||||
#define __NR_msgget (0x40000000 + 68)
|
||||
#define __NR_msgsnd (0x40000000 + 69)
|
||||
#define __NR_msgrcv (0x40000000 + 70)
|
||||
#define __NR_msgctl (0x40000000 + 71)
|
||||
#define __NR_fcntl (0x40000000 + 72)
|
||||
#define __NR_flock (0x40000000 + 73)
|
||||
#define __NR_fsync (0x40000000 + 74)
|
||||
#define __NR_fdatasync (0x40000000 + 75)
|
||||
#define __NR_truncate (0x40000000 + 76)
|
||||
#define __NR_ftruncate (0x40000000 + 77)
|
||||
#define __NR_getdents (0x40000000 + 78)
|
||||
#define __NR_getcwd (0x40000000 + 79)
|
||||
#define __NR_chdir (0x40000000 + 80)
|
||||
#define __NR_fchdir (0x40000000 + 81)
|
||||
#define __NR_rename (0x40000000 + 82)
|
||||
#define __NR_mkdir (0x40000000 + 83)
|
||||
#define __NR_rmdir (0x40000000 + 84)
|
||||
#define __NR_creat (0x40000000 + 85)
|
||||
#define __NR_link (0x40000000 + 86)
|
||||
#define __NR_unlink (0x40000000 + 87)
|
||||
#define __NR_symlink (0x40000000 + 88)
|
||||
#define __NR_readlink (0x40000000 + 89)
|
||||
#define __NR_chmod (0x40000000 + 90)
|
||||
#define __NR_fchmod (0x40000000 + 91)
|
||||
#define __NR_chown (0x40000000 + 92)
|
||||
#define __NR_fchown (0x40000000 + 93)
|
||||
#define __NR_lchown (0x40000000 + 94)
|
||||
#define __NR_umask (0x40000000 + 95)
|
||||
#define __NR_gettimeofday (0x40000000 + 96)
|
||||
#define __NR_getrlimit (0x40000000 + 97)
|
||||
#define __NR_getrusage (0x40000000 + 98)
|
||||
#define __NR_sysinfo (0x40000000 + 99)
|
||||
#define __NR_times (0x40000000 + 100)
|
||||
#define __NR_getuid (0x40000000 + 102)
|
||||
#define __NR_syslog (0x40000000 + 103)
|
||||
#define __NR_getgid (0x40000000 + 104)
|
||||
#define __NR_setuid (0x40000000 + 105)
|
||||
#define __NR_setgid (0x40000000 + 106)
|
||||
#define __NR_geteuid (0x40000000 + 107)
|
||||
#define __NR_getegid (0x40000000 + 108)
|
||||
#define __NR_setpgid (0x40000000 + 109)
|
||||
#define __NR_getppid (0x40000000 + 110)
|
||||
#define __NR_getpgrp (0x40000000 + 111)
|
||||
#define __NR_setsid (0x40000000 + 112)
|
||||
#define __NR_setreuid (0x40000000 + 113)
|
||||
#define __NR_setregid (0x40000000 + 114)
|
||||
#define __NR_getgroups (0x40000000 + 115)
|
||||
#define __NR_setgroups (0x40000000 + 116)
|
||||
#define __NR_setresuid (0x40000000 + 117)
|
||||
#define __NR_getresuid (0x40000000 + 118)
|
||||
#define __NR_setresgid (0x40000000 + 119)
|
||||
#define __NR_getresgid (0x40000000 + 120)
|
||||
#define __NR_getpgid (0x40000000 + 121)
|
||||
#define __NR_setfsuid (0x40000000 + 122)
|
||||
#define __NR_setfsgid (0x40000000 + 123)
|
||||
#define __NR_getsid (0x40000000 + 124)
|
||||
#define __NR_capget (0x40000000 + 125)
|
||||
#define __NR_capset (0x40000000 + 126)
|
||||
#define __NR_rt_sigsuspend (0x40000000 + 130)
|
||||
#define __NR_utime (0x40000000 + 132)
|
||||
#define __NR_mknod (0x40000000 + 133)
|
||||
#define __NR_personality (0x40000000 + 135)
|
||||
#define __NR_ustat (0x40000000 + 136)
|
||||
#define __NR_statfs (0x40000000 + 137)
|
||||
#define __NR_fstatfs (0x40000000 + 138)
|
||||
#define __NR_sysfs (0x40000000 + 139)
|
||||
#define __NR_getpriority (0x40000000 + 140)
|
||||
#define __NR_setpriority (0x40000000 + 141)
|
||||
#define __NR_sched_setparam (0x40000000 + 142)
|
||||
#define __NR_sched_getparam (0x40000000 + 143)
|
||||
#define __NR_sched_setscheduler (0x40000000 + 144)
|
||||
#define __NR_sched_getscheduler (0x40000000 + 145)
|
||||
#define __NR_sched_get_priority_max (0x40000000 + 146)
|
||||
#define __NR_sched_get_priority_min (0x40000000 + 147)
|
||||
#define __NR_sched_rr_get_interval (0x40000000 + 148)
|
||||
#define __NR_mlock (0x40000000 + 149)
|
||||
#define __NR_munlock (0x40000000 + 150)
|
||||
#define __NR_mlockall (0x40000000 + 151)
|
||||
#define __NR_munlockall (0x40000000 + 152)
|
||||
#define __NR_vhangup (0x40000000 + 153)
|
||||
#define __NR_modify_ldt (0x40000000 + 154)
|
||||
#define __NR_pivot_root (0x40000000 + 155)
|
||||
#define __NR_prctl (0x40000000 + 157)
|
||||
#define __NR_arch_prctl (0x40000000 + 158)
|
||||
#define __NR_adjtimex (0x40000000 + 159)
|
||||
#define __NR_setrlimit (0x40000000 + 160)
|
||||
#define __NR_chroot (0x40000000 + 161)
|
||||
#define __NR_sync (0x40000000 + 162)
|
||||
#define __NR_acct (0x40000000 + 163)
|
||||
#define __NR_settimeofday (0x40000000 + 164)
|
||||
#define __NR_mount (0x40000000 + 165)
|
||||
#define __NR_umount2 (0x40000000 + 166)
|
||||
#define __NR_swapon (0x40000000 + 167)
|
||||
#define __NR_swapoff (0x40000000 + 168)
|
||||
#define __NR_reboot (0x40000000 + 169)
|
||||
#define __NR_sethostname (0x40000000 + 170)
|
||||
#define __NR_setdomainname (0x40000000 + 171)
|
||||
#define __NR_iopl (0x40000000 + 172)
|
||||
#define __NR_ioperm (0x40000000 + 173)
|
||||
#define __NR_init_module (0x40000000 + 175)
|
||||
#define __NR_delete_module (0x40000000 + 176)
|
||||
#define __NR_quotactl (0x40000000 + 179)
|
||||
#define __NR_getpmsg (0x40000000 + 181)
|
||||
#define __NR_putpmsg (0x40000000 + 182)
|
||||
#define __NR_afs_syscall (0x40000000 + 183)
|
||||
#define __NR_tuxcall (0x40000000 + 184)
|
||||
#define __NR_security (0x40000000 + 185)
|
||||
#define __NR_gettid (0x40000000 + 186)
|
||||
#define __NR_readahead (0x40000000 + 187)
|
||||
#define __NR_setxattr (0x40000000 + 188)
|
||||
#define __NR_lsetxattr (0x40000000 + 189)
|
||||
#define __NR_fsetxattr (0x40000000 + 190)
|
||||
#define __NR_getxattr (0x40000000 + 191)
|
||||
#define __NR_lgetxattr (0x40000000 + 192)
|
||||
#define __NR_fgetxattr (0x40000000 + 193)
|
||||
#define __NR_listxattr (0x40000000 + 194)
|
||||
#define __NR_llistxattr (0x40000000 + 195)
|
||||
#define __NR_flistxattr (0x40000000 + 196)
|
||||
#define __NR_removexattr (0x40000000 + 197)
|
||||
#define __NR_lremovexattr (0x40000000 + 198)
|
||||
#define __NR_fremovexattr (0x40000000 + 199)
|
||||
#define __NR_tkill (0x40000000 + 200)
|
||||
#define __NR_time (0x40000000 + 201)
|
||||
#define __NR_futex (0x40000000 + 202)
|
||||
#define __NR_sched_setaffinity (0x40000000 + 203)
|
||||
#define __NR_sched_getaffinity (0x40000000 + 204)
|
||||
#define __NR_io_destroy (0x40000000 + 207)
|
||||
#define __NR_io_getevents (0x40000000 + 208)
|
||||
#define __NR_io_cancel (0x40000000 + 210)
|
||||
#define __NR_lookup_dcookie (0x40000000 + 212)
|
||||
#define __NR_epoll_create (0x40000000 + 213)
|
||||
#define __NR_remap_file_pages (0x40000000 + 216)
|
||||
#define __NR_getdents64 (0x40000000 + 217)
|
||||
#define __NR_set_tid_address (0x40000000 + 218)
|
||||
#define __NR_restart_syscall (0x40000000 + 219)
|
||||
#define __NR_semtimedop (0x40000000 + 220)
|
||||
#define __NR_fadvise64 (0x40000000 + 221)
|
||||
#define __NR_timer_settime (0x40000000 + 223)
|
||||
#define __NR_timer_gettime (0x40000000 + 224)
|
||||
#define __NR_timer_getoverrun (0x40000000 + 225)
|
||||
#define __NR_timer_delete (0x40000000 + 226)
|
||||
#define __NR_clock_settime (0x40000000 + 227)
|
||||
#define __NR_clock_gettime (0x40000000 + 228)
|
||||
#define __NR_clock_getres (0x40000000 + 229)
|
||||
#define __NR_clock_nanosleep (0x40000000 + 230)
|
||||
#define __NR_exit_group (0x40000000 + 231)
|
||||
#define __NR_epoll_wait (0x40000000 + 232)
|
||||
#define __NR_epoll_ctl (0x40000000 + 233)
|
||||
#define __NR_tgkill (0x40000000 + 234)
|
||||
#define __NR_utimes (0x40000000 + 235)
|
||||
#define __NR_mbind (0x40000000 + 237)
|
||||
#define __NR_set_mempolicy (0x40000000 + 238)
|
||||
#define __NR_get_mempolicy (0x40000000 + 239)
|
||||
#define __NR_mq_open (0x40000000 + 240)
|
||||
#define __NR_mq_unlink (0x40000000 + 241)
|
||||
#define __NR_mq_timedsend (0x40000000 + 242)
|
||||
#define __NR_mq_timedreceive (0x40000000 + 243)
|
||||
#define __NR_mq_getsetattr (0x40000000 + 245)
|
||||
#define __NR_add_key (0x40000000 + 248)
|
||||
#define __NR_request_key (0x40000000 + 249)
|
||||
#define __NR_keyctl (0x40000000 + 250)
|
||||
#define __NR_ioprio_set (0x40000000 + 251)
|
||||
#define __NR_ioprio_get (0x40000000 + 252)
|
||||
#define __NR_inotify_init (0x40000000 + 253)
|
||||
#define __NR_inotify_add_watch (0x40000000 + 254)
|
||||
#define __NR_inotify_rm_watch (0x40000000 + 255)
|
||||
#define __NR_migrate_pages (0x40000000 + 256)
|
||||
#define __NR_openat (0x40000000 + 257)
|
||||
#define __NR_mkdirat (0x40000000 + 258)
|
||||
#define __NR_mknodat (0x40000000 + 259)
|
||||
#define __NR_fchownat (0x40000000 + 260)
|
||||
#define __NR_futimesat (0x40000000 + 261)
|
||||
#define __NR_newfstatat (0x40000000 + 262)
|
||||
#define __NR_unlinkat (0x40000000 + 263)
|
||||
#define __NR_renameat (0x40000000 + 264)
|
||||
#define __NR_linkat (0x40000000 + 265)
|
||||
#define __NR_symlinkat (0x40000000 + 266)
|
||||
#define __NR_readlinkat (0x40000000 + 267)
|
||||
#define __NR_fchmodat (0x40000000 + 268)
|
||||
#define __NR_faccessat (0x40000000 + 269)
|
||||
#define __NR_pselect6 (0x40000000 + 270)
|
||||
#define __NR_ppoll (0x40000000 + 271)
|
||||
#define __NR_unshare (0x40000000 + 272)
|
||||
#define __NR_splice (0x40000000 + 275)
|
||||
#define __NR_tee (0x40000000 + 276)
|
||||
#define __NR_sync_file_range (0x40000000 + 277)
|
||||
#define __NR_utimensat (0x40000000 + 280)
|
||||
#define __NR_epoll_pwait (0x40000000 + 281)
|
||||
#define __NR_signalfd (0x40000000 + 282)
|
||||
#define __NR_timerfd_create (0x40000000 + 283)
|
||||
#define __NR_eventfd (0x40000000 + 284)
|
||||
#define __NR_fallocate (0x40000000 + 285)
|
||||
#define __NR_timerfd_settime (0x40000000 + 286)
|
||||
#define __NR_timerfd_gettime (0x40000000 + 287)
|
||||
#define __NR_accept4 (0x40000000 + 288)
|
||||
#define __NR_signalfd4 (0x40000000 + 289)
|
||||
#define __NR_eventfd2 (0x40000000 + 290)
|
||||
#define __NR_epoll_create1 (0x40000000 + 291)
|
||||
#define __NR_dup3 (0x40000000 + 292)
|
||||
#define __NR_pipe2 (0x40000000 + 293)
|
||||
#define __NR_inotify_init1 (0x40000000 + 294)
|
||||
#define __NR_perf_event_open (0x40000000 + 298)
|
||||
#define __NR_fanotify_init (0x40000000 + 300)
|
||||
#define __NR_fanotify_mark (0x40000000 + 301)
|
||||
#define __NR_prlimit64 (0x40000000 + 302)
|
||||
#define __NR_name_to_handle_at (0x40000000 + 303)
|
||||
#define __NR_open_by_handle_at (0x40000000 + 304)
|
||||
#define __NR_clock_adjtime (0x40000000 + 305)
|
||||
#define __NR_syncfs (0x40000000 + 306)
|
||||
#define __NR_setns (0x40000000 + 308)
|
||||
#define __NR_getcpu (0x40000000 + 309)
|
||||
#define __NR_kcmp (0x40000000 + 312)
|
||||
#define __NR_finit_module (0x40000000 + 313)
|
||||
#define __NR_sched_setattr (0x40000000 + 314)
|
||||
#define __NR_sched_getattr (0x40000000 + 315)
|
||||
#define __NR_renameat2 (0x40000000 + 316)
|
||||
#define __NR_seccomp (0x40000000 + 317)
|
||||
#define __NR_getrandom (0x40000000 + 318)
|
||||
#define __NR_memfd_create (0x40000000 + 319)
|
||||
#define __NR_kexec_file_load (0x40000000 + 320)
|
||||
#define __NR_bpf (0x40000000 + 321)
|
||||
#define __NR_userfaultfd (0x40000000 + 323)
|
||||
#define __NR_membarrier (0x40000000 + 324)
|
||||
#define __NR_mlock2 (0x40000000 + 325)
|
||||
#define __NR_copy_file_range (0x40000000 + 326)
|
||||
#define __NR_pkey_mprotect (0x40000000 + 329)
|
||||
#define __NR_pkey_alloc (0x40000000 + 330)
|
||||
#define __NR_pkey_free (0x40000000 + 331)
|
||||
#define __NR_statx (0x40000000 + 332)
|
||||
#define __NR_io_pgetevents (0x40000000 + 333)
|
||||
#define __NR_rseq (0x40000000 + 334)
|
||||
#define __NR_pidfd_send_signal (0x40000000 + 424)
|
||||
#define __NR_io_uring_setup (0x40000000 + 425)
|
||||
#define __NR_io_uring_enter (0x40000000 + 426)
|
||||
#define __NR_io_uring_register (0x40000000 + 427)
|
||||
#define __NR_open_tree (0x40000000 + 428)
|
||||
#define __NR_move_mount (0x40000000 + 429)
|
||||
#define __NR_fsopen (0x40000000 + 430)
|
||||
#define __NR_fsconfig (0x40000000 + 431)
|
||||
#define __NR_fsmount (0x40000000 + 432)
|
||||
#define __NR_fspick (0x40000000 + 433)
|
||||
#define __NR_pidfd_open (0x40000000 + 434)
|
||||
#define __NR_clone3 (0x40000000 + 435)
|
||||
#define __NR_close_range (0x40000000 + 436)
|
||||
#define __NR_openat2 (0x40000000 + 437)
|
||||
#define __NR_pidfd_getfd (0x40000000 + 438)
|
||||
#define __NR_faccessat2 (0x40000000 + 439)
|
||||
#define __NR_process_madvise (0x40000000 + 440)
|
||||
#define __NR_epoll_pwait2 (0x40000000 + 441)
|
||||
#define __NR_mount_setattr (0x40000000 + 442)
|
||||
#define __NR_landlock_create_ruleset (0x40000000 + 444)
|
||||
#define __NR_landlock_add_rule (0x40000000 + 445)
|
||||
#define __NR_landlock_restrict_self (0x40000000 + 446)
|
||||
#define __NR_memfd_secret (0x40000000 + 447)
|
||||
#define __NR_process_mrelease (0x40000000 + 448)
|
||||
#define __NR_futex_waitv (0x40000000 + 449)
|
||||
#define __NR_set_mempolicy_home_node (0x40000000 + 450)
|
||||
#define __NR_cachestat (0x40000000 + 451)
|
||||
#define __NR_fchmodat2 (0x40000000 + 452)
|
||||
|
||||
|
||||
#define __NR_rt_sigaction (0x40000000 + 512)
|
||||
#define __NR_rt_sigreturn (0x40000000 + 513)
|
||||
#define __NR_ioctl (0x40000000 + 514)
|
||||
#define __NR_readv (0x40000000 + 515)
|
||||
#define __NR_writev (0x40000000 + 516)
|
||||
#define __NR_recvfrom (0x40000000 + 517)
|
||||
#define __NR_sendmsg (0x40000000 + 518)
|
||||
#define __NR_recvmsg (0x40000000 + 519)
|
||||
#define __NR_execve (0x40000000 + 520)
|
||||
#define __NR_ptrace (0x40000000 + 521)
|
||||
#define __NR_rt_sigpending (0x40000000 + 522)
|
||||
#define __NR_rt_sigtimedwait (0x40000000 + 523)
|
||||
#define __NR_rt_sigqueueinfo (0x40000000 + 524)
|
||||
#define __NR_sigaltstack (0x40000000 + 525)
|
||||
#define __NR_timer_create (0x40000000 + 526)
|
||||
#define __NR_mq_notify (0x40000000 + 527)
|
||||
#define __NR_kexec_load (0x40000000 + 528)
|
||||
#define __NR_waitid (0x40000000 + 529)
|
||||
#define __NR_set_robust_list (0x40000000 + 530)
|
||||
#define __NR_get_robust_list (0x40000000 + 531)
|
||||
#define __NR_vmsplice (0x40000000 + 532)
|
||||
#define __NR_move_pages (0x40000000 + 533)
|
||||
#define __NR_preadv (0x40000000 + 534)
|
||||
#define __NR_pwritev (0x40000000 + 535)
|
||||
#define __NR_rt_tgsigqueueinfo (0x40000000 + 536)
|
||||
#define __NR_recvmmsg (0x40000000 + 537)
|
||||
#define __NR_sendmmsg (0x40000000 + 538)
|
||||
#define __NR_process_vm_readv (0x40000000 + 539)
|
||||
#define __NR_process_vm_writev (0x40000000 + 540)
|
||||
#define __NR_setsockopt (0x40000000 + 541)
|
||||
#define __NR_getsockopt (0x40000000 + 542)
|
||||
#define __NR_io_setup (0x40000000 + 543)
|
||||
#define __NR_io_submit (0x40000000 + 544)
|
||||
#define __NR_execveat (0x40000000 + 545)
|
||||
#define __NR_preadv2 (0x40000000 + 546)
|
||||
#define __NR_pwritev2 (0x40000000 + 547)
|
||||
|
||||
#define SYS_read (0x40000000 + 0)
|
||||
#define SYS_write (0x40000000 + 1)
|
||||
#define SYS_open (0x40000000 + 2)
|
||||
#define SYS_close (0x40000000 + 3)
|
||||
#define SYS_stat (0x40000000 + 4)
|
||||
#define SYS_fstat (0x40000000 + 5)
|
||||
#define SYS_lstat (0x40000000 + 6)
|
||||
#define SYS_poll (0x40000000 + 7)
|
||||
#define SYS_lseek (0x40000000 + 8)
|
||||
#define SYS_mmap (0x40000000 + 9)
|
||||
#define SYS_mprotect (0x40000000 + 10)
|
||||
#define SYS_munmap (0x40000000 + 11)
|
||||
#define SYS_brk (0x40000000 + 12)
|
||||
#define SYS_rt_sigprocmask (0x40000000 + 14)
|
||||
#define SYS_pread64 (0x40000000 + 17)
|
||||
#define SYS_pwrite64 (0x40000000 + 18)
|
||||
#define SYS_access (0x40000000 + 21)
|
||||
#define SYS_pipe (0x40000000 + 22)
|
||||
#define SYS_select (0x40000000 + 23)
|
||||
#define SYS_sched_yield (0x40000000 + 24)
|
||||
#define SYS_mremap (0x40000000 + 25)
|
||||
#define SYS_msync (0x40000000 + 26)
|
||||
#define SYS_mincore (0x40000000 + 27)
|
||||
#define SYS_madvise (0x40000000 + 28)
|
||||
#define SYS_shmget (0x40000000 + 29)
|
||||
#define SYS_shmat (0x40000000 + 30)
|
||||
#define SYS_shmctl (0x40000000 + 31)
|
||||
#define SYS_dup (0x40000000 + 32)
|
||||
#define SYS_dup2 (0x40000000 + 33)
|
||||
#define SYS_pause (0x40000000 + 34)
|
||||
#define SYS_nanosleep (0x40000000 + 35)
|
||||
#define SYS_getitimer (0x40000000 + 36)
|
||||
#define SYS_alarm (0x40000000 + 37)
|
||||
#define SYS_setitimer (0x40000000 + 38)
|
||||
#define SYS_getpid (0x40000000 + 39)
|
||||
#define SYS_sendfile (0x40000000 + 40)
|
||||
#define SYS_socket (0x40000000 + 41)
|
||||
#define SYS_connect (0x40000000 + 42)
|
||||
#define SYS_accept (0x40000000 + 43)
|
||||
#define SYS_sendto (0x40000000 + 44)
|
||||
#define SYS_shutdown (0x40000000 + 48)
|
||||
#define SYS_bind (0x40000000 + 49)
|
||||
#define SYS_listen (0x40000000 + 50)
|
||||
#define SYS_getsockname (0x40000000 + 51)
|
||||
#define SYS_getpeername (0x40000000 + 52)
|
||||
#define SYS_socketpair (0x40000000 + 53)
|
||||
#define SYS_clone (0x40000000 + 56)
|
||||
#define SYS_fork (0x40000000 + 57)
|
||||
#define SYS_vfork (0x40000000 + 58)
|
||||
#define SYS_exit (0x40000000 + 60)
|
||||
#define SYS_wait4 (0x40000000 + 61)
|
||||
#define SYS_kill (0x40000000 + 62)
|
||||
#define SYS_uname (0x40000000 + 63)
|
||||
#define SYS_semget (0x40000000 + 64)
|
||||
#define SYS_semop (0x40000000 + 65)
|
||||
#define SYS_semctl (0x40000000 + 66)
|
||||
#define SYS_shmdt (0x40000000 + 67)
|
||||
#define SYS_msgget (0x40000000 + 68)
|
||||
#define SYS_msgsnd (0x40000000 + 69)
|
||||
#define SYS_msgrcv (0x40000000 + 70)
|
||||
#define SYS_msgctl (0x40000000 + 71)
|
||||
#define SYS_fcntl (0x40000000 + 72)
|
||||
#define SYS_flock (0x40000000 + 73)
|
||||
#define SYS_fsync (0x40000000 + 74)
|
||||
#define SYS_fdatasync (0x40000000 + 75)
|
||||
#define SYS_truncate (0x40000000 + 76)
|
||||
#define SYS_ftruncate (0x40000000 + 77)
|
||||
#define SYS_getdents (0x40000000 + 78)
|
||||
#define SYS_getcwd (0x40000000 + 79)
|
||||
#define SYS_chdir (0x40000000 + 80)
|
||||
#define SYS_fchdir (0x40000000 + 81)
|
||||
#define SYS_rename (0x40000000 + 82)
|
||||
#define SYS_mkdir (0x40000000 + 83)
|
||||
#define SYS_rmdir (0x40000000 + 84)
|
||||
#define SYS_creat (0x40000000 + 85)
|
||||
#define SYS_link (0x40000000 + 86)
|
||||
#define SYS_unlink (0x40000000 + 87)
|
||||
#define SYS_symlink (0x40000000 + 88)
|
||||
#define SYS_readlink (0x40000000 + 89)
|
||||
#define SYS_chmod (0x40000000 + 90)
|
||||
#define SYS_fchmod (0x40000000 + 91)
|
||||
#define SYS_chown (0x40000000 + 92)
|
||||
#define SYS_fchown (0x40000000 + 93)
|
||||
#define SYS_lchown (0x40000000 + 94)
|
||||
#define SYS_umask (0x40000000 + 95)
|
||||
#define SYS_gettimeofday (0x40000000 + 96)
|
||||
#define SYS_getrlimit (0x40000000 + 97)
|
||||
#define SYS_getrusage (0x40000000 + 98)
|
||||
#define SYS_sysinfo (0x40000000 + 99)
|
||||
#define SYS_times (0x40000000 + 100)
|
||||
#define SYS_getuid (0x40000000 + 102)
|
||||
#define SYS_syslog (0x40000000 + 103)
|
||||
#define SYS_getgid (0x40000000 + 104)
|
||||
#define SYS_setuid (0x40000000 + 105)
|
||||
#define SYS_setgid (0x40000000 + 106)
|
||||
#define SYS_geteuid (0x40000000 + 107)
|
||||
#define SYS_getegid (0x40000000 + 108)
|
||||
#define SYS_setpgid (0x40000000 + 109)
|
||||
#define SYS_getppid (0x40000000 + 110)
|
||||
#define SYS_getpgrp (0x40000000 + 111)
|
||||
#define SYS_setsid (0x40000000 + 112)
|
||||
#define SYS_setreuid (0x40000000 + 113)
|
||||
#define SYS_setregid (0x40000000 + 114)
|
||||
#define SYS_getgroups (0x40000000 + 115)
|
||||
#define SYS_setgroups (0x40000000 + 116)
|
||||
#define SYS_setresuid (0x40000000 + 117)
|
||||
#define SYS_getresuid (0x40000000 + 118)
|
||||
#define SYS_setresgid (0x40000000 + 119)
|
||||
#define SYS_getresgid (0x40000000 + 120)
|
||||
#define SYS_getpgid (0x40000000 + 121)
|
||||
#define SYS_setfsuid (0x40000000 + 122)
|
||||
#define SYS_setfsgid (0x40000000 + 123)
|
||||
#define SYS_getsid (0x40000000 + 124)
|
||||
#define SYS_capget (0x40000000 + 125)
|
||||
#define SYS_capset (0x40000000 + 126)
|
||||
#define SYS_rt_sigsuspend (0x40000000 + 130)
|
||||
#define SYS_utime (0x40000000 + 132)
|
||||
#define SYS_mknod (0x40000000 + 133)
|
||||
#define SYS_personality (0x40000000 + 135)
|
||||
#define SYS_ustat (0x40000000 + 136)
|
||||
#define SYS_statfs (0x40000000 + 137)
|
||||
#define SYS_fstatfs (0x40000000 + 138)
|
||||
#define SYS_sysfs (0x40000000 + 139)
|
||||
#define SYS_getpriority (0x40000000 + 140)
|
||||
#define SYS_setpriority (0x40000000 + 141)
|
||||
#define SYS_sched_setparam (0x40000000 + 142)
|
||||
#define SYS_sched_getparam (0x40000000 + 143)
|
||||
#define SYS_sched_setscheduler (0x40000000 + 144)
|
||||
#define SYS_sched_getscheduler (0x40000000 + 145)
|
||||
#define SYS_sched_get_priority_max (0x40000000 + 146)
|
||||
#define SYS_sched_get_priority_min (0x40000000 + 147)
|
||||
#define SYS_sched_rr_get_interval (0x40000000 + 148)
|
||||
#define SYS_mlock (0x40000000 + 149)
|
||||
#define SYS_munlock (0x40000000 + 150)
|
||||
#define SYS_mlockall (0x40000000 + 151)
|
||||
#define SYS_munlockall (0x40000000 + 152)
|
||||
#define SYS_vhangup (0x40000000 + 153)
|
||||
#define SYS_modify_ldt (0x40000000 + 154)
|
||||
#define SYS_pivot_root (0x40000000 + 155)
|
||||
#define SYS_prctl (0x40000000 + 157)
|
||||
#define SYS_arch_prctl (0x40000000 + 158)
|
||||
#define SYS_adjtimex (0x40000000 + 159)
|
||||
#define SYS_setrlimit (0x40000000 + 160)
|
||||
#define SYS_chroot (0x40000000 + 161)
|
||||
#define SYS_sync (0x40000000 + 162)
|
||||
#define SYS_acct (0x40000000 + 163)
|
||||
#define SYS_settimeofday (0x40000000 + 164)
|
||||
#define SYS_mount (0x40000000 + 165)
|
||||
#define SYS_umount2 (0x40000000 + 166)
|
||||
#define SYS_swapon (0x40000000 + 167)
|
||||
#define SYS_swapoff (0x40000000 + 168)
|
||||
#define SYS_reboot (0x40000000 + 169)
|
||||
#define SYS_sethostname (0x40000000 + 170)
|
||||
#define SYS_setdomainname (0x40000000 + 171)
|
||||
#define SYS_iopl (0x40000000 + 172)
|
||||
#define SYS_ioperm (0x40000000 + 173)
|
||||
#define SYS_init_module (0x40000000 + 175)
|
||||
#define SYS_delete_module (0x40000000 + 176)
|
||||
#define SYS_quotactl (0x40000000 + 179)
|
||||
#define SYS_getpmsg (0x40000000 + 181)
|
||||
#define SYS_putpmsg (0x40000000 + 182)
|
||||
#define SYS_afs_syscall (0x40000000 + 183)
|
||||
#define SYS_tuxcall (0x40000000 + 184)
|
||||
#define SYS_security (0x40000000 + 185)
|
||||
#define SYS_gettid (0x40000000 + 186)
|
||||
#define SYS_readahead (0x40000000 + 187)
|
||||
#define SYS_setxattr (0x40000000 + 188)
|
||||
#define SYS_lsetxattr (0x40000000 + 189)
|
||||
#define SYS_fsetxattr (0x40000000 + 190)
|
||||
#define SYS_getxattr (0x40000000 + 191)
|
||||
#define SYS_lgetxattr (0x40000000 + 192)
|
||||
#define SYS_fgetxattr (0x40000000 + 193)
|
||||
#define SYS_listxattr (0x40000000 + 194)
|
||||
#define SYS_llistxattr (0x40000000 + 195)
|
||||
#define SYS_flistxattr (0x40000000 + 196)
|
||||
#define SYS_removexattr (0x40000000 + 197)
|
||||
#define SYS_lremovexattr (0x40000000 + 198)
|
||||
#define SYS_fremovexattr (0x40000000 + 199)
|
||||
#define SYS_tkill (0x40000000 + 200)
|
||||
#define SYS_time (0x40000000 + 201)
|
||||
#define SYS_futex (0x40000000 + 202)
|
||||
#define SYS_sched_setaffinity (0x40000000 + 203)
|
||||
#define SYS_sched_getaffinity (0x40000000 + 204)
|
||||
#define SYS_io_destroy (0x40000000 + 207)
|
||||
#define SYS_io_getevents (0x40000000 + 208)
|
||||
#define SYS_io_cancel (0x40000000 + 210)
|
||||
#define SYS_lookup_dcookie (0x40000000 + 212)
|
||||
#define SYS_epoll_create (0x40000000 + 213)
|
||||
#define SYS_remap_file_pages (0x40000000 + 216)
|
||||
#define SYS_getdents64 (0x40000000 + 217)
|
||||
#define SYS_set_tid_address (0x40000000 + 218)
|
||||
#define SYS_restart_syscall (0x40000000 + 219)
|
||||
#define SYS_semtimedop (0x40000000 + 220)
|
||||
#define SYS_fadvise64 (0x40000000 + 221)
|
||||
#define SYS_timer_settime (0x40000000 + 223)
|
||||
#define SYS_timer_gettime (0x40000000 + 224)
|
||||
#define SYS_timer_getoverrun (0x40000000 + 225)
|
||||
#define SYS_timer_delete (0x40000000 + 226)
|
||||
#define SYS_clock_settime (0x40000000 + 227)
|
||||
#define SYS_clock_gettime (0x40000000 + 228)
|
||||
#define SYS_clock_getres (0x40000000 + 229)
|
||||
#define SYS_clock_nanosleep (0x40000000 + 230)
|
||||
#define SYS_exit_group (0x40000000 + 231)
|
||||
#define SYS_epoll_wait (0x40000000 + 232)
|
||||
#define SYS_epoll_ctl (0x40000000 + 233)
|
||||
#define SYS_tgkill (0x40000000 + 234)
|
||||
#define SYS_utimes (0x40000000 + 235)
|
||||
#define SYS_mbind (0x40000000 + 237)
|
||||
#define SYS_set_mempolicy (0x40000000 + 238)
|
||||
#define SYS_get_mempolicy (0x40000000 + 239)
|
||||
#define SYS_mq_open (0x40000000 + 240)
|
||||
#define SYS_mq_unlink (0x40000000 + 241)
|
||||
#define SYS_mq_timedsend (0x40000000 + 242)
|
||||
#define SYS_mq_timedreceive (0x40000000 + 243)
|
||||
#define SYS_mq_getsetattr (0x40000000 + 245)
|
||||
#define SYS_add_key (0x40000000 + 248)
|
||||
#define SYS_request_key (0x40000000 + 249)
|
||||
#define SYS_keyctl (0x40000000 + 250)
|
||||
#define SYS_ioprio_set (0x40000000 + 251)
|
||||
#define SYS_ioprio_get (0x40000000 + 252)
|
||||
#define SYS_inotify_init (0x40000000 + 253)
|
||||
#define SYS_inotify_add_watch (0x40000000 + 254)
|
||||
#define SYS_inotify_rm_watch (0x40000000 + 255)
|
||||
#define SYS_migrate_pages (0x40000000 + 256)
|
||||
#define SYS_openat (0x40000000 + 257)
|
||||
#define SYS_mkdirat (0x40000000 + 258)
|
||||
#define SYS_mknodat (0x40000000 + 259)
|
||||
#define SYS_fchownat (0x40000000 + 260)
|
||||
#define SYS_futimesat (0x40000000 + 261)
|
||||
#define SYS_newfstatat (0x40000000 + 262)
|
||||
#define SYS_unlinkat (0x40000000 + 263)
|
||||
#define SYS_renameat (0x40000000 + 264)
|
||||
#define SYS_linkat (0x40000000 + 265)
|
||||
#define SYS_symlinkat (0x40000000 + 266)
|
||||
#define SYS_readlinkat (0x40000000 + 267)
|
||||
#define SYS_fchmodat (0x40000000 + 268)
|
||||
#define SYS_faccessat (0x40000000 + 269)
|
||||
#define SYS_pselect6 (0x40000000 + 270)
|
||||
#define SYS_ppoll (0x40000000 + 271)
|
||||
#define SYS_unshare (0x40000000 + 272)
|
||||
#define SYS_splice (0x40000000 + 275)
|
||||
#define SYS_tee (0x40000000 + 276)
|
||||
#define SYS_sync_file_range (0x40000000 + 277)
|
||||
#define SYS_utimensat (0x40000000 + 280)
|
||||
#define SYS_epoll_pwait (0x40000000 + 281)
|
||||
#define SYS_signalfd (0x40000000 + 282)
|
||||
#define SYS_timerfd_create (0x40000000 + 283)
|
||||
#define SYS_eventfd (0x40000000 + 284)
|
||||
#define SYS_fallocate (0x40000000 + 285)
|
||||
#define SYS_timerfd_settime (0x40000000 + 286)
|
||||
#define SYS_timerfd_gettime (0x40000000 + 287)
|
||||
#define SYS_accept4 (0x40000000 + 288)
|
||||
#define SYS_signalfd4 (0x40000000 + 289)
|
||||
#define SYS_eventfd2 (0x40000000 + 290)
|
||||
#define SYS_epoll_create1 (0x40000000 + 291)
|
||||
#define SYS_dup3 (0x40000000 + 292)
|
||||
#define SYS_pipe2 (0x40000000 + 293)
|
||||
#define SYS_inotify_init1 (0x40000000 + 294)
|
||||
#define SYS_perf_event_open (0x40000000 + 298)
|
||||
#define SYS_fanotify_init (0x40000000 + 300)
|
||||
#define SYS_fanotify_mark (0x40000000 + 301)
|
||||
#define SYS_prlimit64 (0x40000000 + 302)
|
||||
#define SYS_name_to_handle_at (0x40000000 + 303)
|
||||
#define SYS_open_by_handle_at (0x40000000 + 304)
|
||||
#define SYS_clock_adjtime (0x40000000 + 305)
|
||||
#define SYS_syncfs (0x40000000 + 306)
|
||||
#define SYS_setns (0x40000000 + 308)
|
||||
#define SYS_getcpu (0x40000000 + 309)
|
||||
#define SYS_kcmp (0x40000000 + 312)
|
||||
#define SYS_finit_module (0x40000000 + 313)
|
||||
#define SYS_sched_setattr (0x40000000 + 314)
|
||||
#define SYS_sched_getattr (0x40000000 + 315)
|
||||
#define SYS_renameat2 (0x40000000 + 316)
|
||||
#define SYS_seccomp (0x40000000 + 317)
|
||||
#define SYS_getrandom (0x40000000 + 318)
|
||||
#define SYS_memfd_create (0x40000000 + 319)
|
||||
#define SYS_kexec_file_load (0x40000000 + 320)
|
||||
#define SYS_bpf (0x40000000 + 321)
|
||||
#define SYS_userfaultfd (0x40000000 + 323)
|
||||
#define SYS_membarrier (0x40000000 + 324)
|
||||
#define SYS_mlock2 (0x40000000 + 325)
|
||||
#define SYS_copy_file_range (0x40000000 + 326)
|
||||
#define SYS_pkey_mprotect (0x40000000 + 329)
|
||||
#define SYS_pkey_alloc (0x40000000 + 330)
|
||||
#define SYS_pkey_free (0x40000000 + 331)
|
||||
#define SYS_statx (0x40000000 + 332)
|
||||
#define SYS_io_pgetevents (0x40000000 + 333)
|
||||
#define SYS_rseq (0x40000000 + 334)
|
||||
#define SYS_pidfd_send_signal (0x40000000 + 424)
|
||||
#define SYS_io_uring_setup (0x40000000 + 425)
|
||||
#define SYS_io_uring_enter (0x40000000 + 426)
|
||||
#define SYS_io_uring_register (0x40000000 + 427)
|
||||
#define SYS_open_tree (0x40000000 + 428)
|
||||
#define SYS_move_mount (0x40000000 + 429)
|
||||
#define SYS_fsopen (0x40000000 + 430)
|
||||
#define SYS_fsconfig (0x40000000 + 431)
|
||||
#define SYS_fsmount (0x40000000 + 432)
|
||||
#define SYS_fspick (0x40000000 + 433)
|
||||
#define SYS_pidfd_open (0x40000000 + 434)
|
||||
#define SYS_clone3 (0x40000000 + 435)
|
||||
#define SYS_close_range (0x40000000 + 436)
|
||||
#define SYS_openat2 (0x40000000 + 437)
|
||||
#define SYS_pidfd_getfd (0x40000000 + 438)
|
||||
#define SYS_faccessat2 (0x40000000 + 439)
|
||||
#define SYS_process_madvise (0x40000000 + 440)
|
||||
#define SYS_epoll_pwait2 (0x40000000 + 441)
|
||||
#define SYS_mount_setattr (0x40000000 + 442)
|
||||
#define SYS_landlock_create_ruleset (0x40000000 + 444)
|
||||
#define SYS_landlock_add_rule (0x40000000 + 445)
|
||||
#define SYS_landlock_restrict_self (0x40000000 + 446)
|
||||
#define SYS_memfd_secret (0x40000000 + 447)
|
||||
#define SYS_process_mrelease (0x40000000 + 448)
|
||||
#define SYS_futex_waitv (0x40000000 + 449)
|
||||
#define SYS_set_mempolicy_home_node (0x40000000 + 450)
|
||||
#define SYS_cachestat (0x40000000 + 451)
|
||||
#define SYS_fchmodat2 (0x40000000 + 452)
|
||||
#define SYS_rt_sigaction (0x40000000 + 512)
|
||||
#define SYS_rt_sigreturn (0x40000000 + 513)
|
||||
#define SYS_ioctl (0x40000000 + 514)
|
||||
#define SYS_readv (0x40000000 + 515)
|
||||
#define SYS_writev (0x40000000 + 516)
|
||||
#define SYS_recvfrom (0x40000000 + 517)
|
||||
#define SYS_sendmsg (0x40000000 + 518)
|
||||
#define SYS_recvmsg (0x40000000 + 519)
|
||||
#define SYS_execve (0x40000000 + 520)
|
||||
#define SYS_ptrace (0x40000000 + 521)
|
||||
#define SYS_rt_sigpending (0x40000000 + 522)
|
||||
#define SYS_rt_sigtimedwait (0x40000000 + 523)
|
||||
#define SYS_rt_sigqueueinfo (0x40000000 + 524)
|
||||
#define SYS_sigaltstack (0x40000000 + 525)
|
||||
#define SYS_timer_create (0x40000000 + 526)
|
||||
#define SYS_mq_notify (0x40000000 + 527)
|
||||
#define SYS_kexec_load (0x40000000 + 528)
|
||||
#define SYS_waitid (0x40000000 + 529)
|
||||
#define SYS_set_robust_list (0x40000000 + 530)
|
||||
#define SYS_get_robust_list (0x40000000 + 531)
|
||||
#define SYS_vmsplice (0x40000000 + 532)
|
||||
#define SYS_move_pages (0x40000000 + 533)
|
||||
#define SYS_preadv (0x40000000 + 534)
|
||||
#define SYS_pwritev (0x40000000 + 535)
|
||||
#define SYS_rt_tgsigqueueinfo (0x40000000 + 536)
|
||||
#define SYS_recvmmsg (0x40000000 + 537)
|
||||
#define SYS_sendmmsg (0x40000000 + 538)
|
||||
#define SYS_process_vm_readv (0x40000000 + 539)
|
||||
#define SYS_process_vm_writev (0x40000000 + 540)
|
||||
#define SYS_setsockopt (0x40000000 + 541)
|
||||
#define SYS_getsockopt (0x40000000 + 542)
|
||||
#define SYS_io_setup (0x40000000 + 543)
|
||||
#define SYS_io_submit (0x40000000 + 544)
|
||||
#define SYS_execveat (0x40000000 + 545)
|
||||
#define SYS_preadv2 (0x40000000 + 546)
|
||||
#define SYS_pwritev2 (0x40000000 + 547)
|
||||
@@ -0,0 +1,41 @@
|
||||
#undef __WORDSIZE
|
||||
#define __WORDSIZE 32
|
||||
|
||||
typedef struct user_fpregs_struct {
|
||||
uint16_t cwd, swd, ftw, fop;
|
||||
uint64_t rip, rdp;
|
||||
uint32_t mxcsr, mxcr_mask;
|
||||
uint32_t st_space[32], xmm_space[64], padding[24];
|
||||
} elf_fpregset_t;
|
||||
|
||||
struct user_regs_struct {
|
||||
unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
|
||||
unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
|
||||
unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
|
||||
};
|
||||
#define ELF_NGREG 27
|
||||
typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
|
||||
|
||||
struct user {
|
||||
struct user_regs_struct regs;
|
||||
int u_fpvalid;
|
||||
struct user_fpregs_struct i387;
|
||||
unsigned long u_tsize;
|
||||
unsigned long u_dsize;
|
||||
unsigned long u_ssize;
|
||||
unsigned long start_code;
|
||||
unsigned long start_stack;
|
||||
long signal;
|
||||
int reserved;
|
||||
struct user_regs_struct *u_ar0;
|
||||
struct user_fpregs_struct *u_fpstate;
|
||||
unsigned long magic;
|
||||
char u_comm[32];
|
||||
unsigned long u_debugreg[8];
|
||||
};
|
||||
|
||||
#define PAGE_MASK (~(PAGESIZE-1))
|
||||
#define NBPG PAGESIZE
|
||||
#define UPAGES 1
|
||||
#define HOST_TEXT_START_ADDR (u.start_code)
|
||||
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef __XTENSA_AUXVEC_H
|
||||
#define __XTENSA_AUXVEC_H
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#ifndef _XTENSA_BYTEORDER_H
|
||||
#define _XTENSA_BYTEORDER_H
|
||||
|
||||
#ifdef __XTENSA_EL__
|
||||
#include <linux/byteorder/little_endian.h>
|
||||
#elif defined(__XTENSA_EB__)
|
||||
#include <linux/byteorder/big_endian.h>
|
||||
#else
|
||||
# error processor byte order undefined!
|
||||
#endif
|
||||
|
||||
#endif /* _XTENSA_BYTEORDER_H */
|
||||
@@ -0,0 +1,130 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/ioctls.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2003 - 2005 Tensilica Inc.
|
||||
*
|
||||
* Derived from "include/asm-i386/ioctls.h"
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_IOCTLS_H
|
||||
#define _XTENSA_IOCTLS_H
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
#define FIOCLEX _IO('f', 1)
|
||||
#define FIONCLEX _IO('f', 2)
|
||||
#define FIOASYNC _IOW('f', 125, int)
|
||||
#define FIONBIO _IOW('f', 126, int)
|
||||
#define FIONREAD _IOR('f', 127, int)
|
||||
#define TIOCINQ FIONREAD
|
||||
#define FIOQSIZE _IOR('f', 128, loff_t)
|
||||
|
||||
#define TCGETS 0x5401
|
||||
#define TCSETS 0x5402
|
||||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
|
||||
#define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */
|
||||
#define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */
|
||||
#define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */
|
||||
#define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */
|
||||
|
||||
#define TCSBRK _IO('t', 29)
|
||||
#define TCXONC _IO('t', 30)
|
||||
#define TCFLSH _IO('t', 31)
|
||||
|
||||
#define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */
|
||||
#define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */
|
||||
#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
|
||||
#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
|
||||
#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
|
||||
|
||||
#define TIOCSPGRP _IOW('t', 118, int)
|
||||
#define TIOCGPGRP _IOR('t', 119, int)
|
||||
|
||||
#define TIOCEXCL _IO('T', 12)
|
||||
#define TIOCNXCL _IO('T', 13)
|
||||
#define TIOCSCTTY _IO('T', 14)
|
||||
|
||||
#define TIOCSTI _IOW('T', 18, char)
|
||||
#define TIOCMGET _IOR('T', 21, unsigned int)
|
||||
#define TIOCMBIS _IOW('T', 22, unsigned int)
|
||||
#define TIOCMBIC _IOW('T', 23, unsigned int)
|
||||
#define TIOCMSET _IOW('T', 24, unsigned int)
|
||||
# define TIOCM_LE 0x001
|
||||
# define TIOCM_DTR 0x002
|
||||
# define TIOCM_RTS 0x004
|
||||
# define TIOCM_ST 0x008
|
||||
# define TIOCM_SR 0x010
|
||||
# define TIOCM_CTS 0x020
|
||||
# define TIOCM_CAR 0x040
|
||||
# define TIOCM_RNG 0x080
|
||||
# define TIOCM_DSR 0x100
|
||||
# define TIOCM_CD TIOCM_CAR
|
||||
# define TIOCM_RI TIOCM_RNG
|
||||
|
||||
#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
|
||||
#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
|
||||
#define TIOCLINUX _IOW('T', 28, char)
|
||||
#define TIOCCONS _IO('T', 29)
|
||||
#define TIOCGSERIAL 0x803C541E /*_IOR('T', 30, struct serial_struct)*/
|
||||
#define TIOCSSERIAL 0x403C541F /*_IOW('T', 31, struct serial_struct)*/
|
||||
#define TIOCPKT _IOW('T', 32, int)
|
||||
# define TIOCPKT_DATA 0
|
||||
# define TIOCPKT_FLUSHREAD 1
|
||||
# define TIOCPKT_FLUSHWRITE 2
|
||||
# define TIOCPKT_STOP 4
|
||||
# define TIOCPKT_START 8
|
||||
# define TIOCPKT_NOSTOP 16
|
||||
# define TIOCPKT_DOSTOP 32
|
||||
# define TIOCPKT_IOCTL 64
|
||||
|
||||
|
||||
#define TIOCNOTTY _IO('T', 34)
|
||||
#define TIOCSETD _IOW('T', 35, int)
|
||||
#define TIOCGETD _IOR('T', 36, int)
|
||||
#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/
|
||||
#define TIOCSBRK _IO('T', 39) /* BSD compatibility */
|
||||
#define TIOCCBRK _IO('T', 40) /* BSD compatibility */
|
||||
#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/
|
||||
#define TCGETS2 _IOR('T', 42, struct termios2)
|
||||
#define TCSETS2 _IOW('T', 43, struct termios2)
|
||||
#define TCSETSW2 _IOW('T', 44, struct termios2)
|
||||
#define TCSETSF2 _IOW('T', 45, struct termios2)
|
||||
#define TIOCGRS485 _IOR('T', 46, struct serial_rs485)
|
||||
#define TIOCSRS485 _IOWR('T', 47, struct serial_rs485)
|
||||
#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
|
||||
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
|
||||
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
|
||||
#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
|
||||
#define TIOCVHANGUP _IO('T', 0x37)
|
||||
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
|
||||
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
|
||||
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
|
||||
#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
|
||||
#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
|
||||
#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
|
||||
|
||||
#define TIOCSERCONFIG _IO('T', 83)
|
||||
#define TIOCSERGWILD _IOR('T', 84, int)
|
||||
#define TIOCSERSWILD _IOW('T', 85, int)
|
||||
#define TIOCGLCKTRMIOS 0x5456
|
||||
#define TIOCSLCKTRMIOS 0x5457
|
||||
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
|
||||
#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */
|
||||
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
|
||||
# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
#define TIOCSERGETMULTI 0x80a8545a /* Get multiport config */
|
||||
/* _IOR('T', 90, struct serial_multiport_struct) */
|
||||
#define TIOCSERSETMULTI 0x40a8545b /* Set multiport config */
|
||||
/* _IOW('T', 91, struct serial_multiport_struct) */
|
||||
|
||||
#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
|
||||
#define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */
|
||||
|
||||
#endif /* _XTENSA_IOCTLS_H */
|
||||
@@ -0,0 +1,40 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/ipcbuf.h
|
||||
*
|
||||
* The ipc64_perm structure for the Xtensa architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_IPCBUF_H
|
||||
#define _XTENSA_IPCBUF_H
|
||||
|
||||
#include <linux/posix_types.h>
|
||||
|
||||
/*
|
||||
* Pad space is left for:
|
||||
* - 32-bit mode_t and seq
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General
|
||||
* Public License. See the file "COPYING" in the main directory of
|
||||
* this archive for more details.
|
||||
*/
|
||||
|
||||
struct ipc64_perm
|
||||
{
|
||||
__kernel_key_t key;
|
||||
__kernel_uid32_t uid;
|
||||
__kernel_gid32_t gid;
|
||||
__kernel_uid32_t cuid;
|
||||
__kernel_gid32_t cgid;
|
||||
__kernel_mode_t mode;
|
||||
unsigned long seq;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
};
|
||||
|
||||
#endif /* _XTENSA_IPCBUF_H */
|
||||
@@ -0,0 +1,127 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/mman.h
|
||||
*
|
||||
* Xtensa Processor memory-manager definitions
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1995 by Ralf Baechle
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_MMAN_H
|
||||
#define _XTENSA_MMAN_H
|
||||
|
||||
/*
|
||||
* Protections are chosen from these bits, OR'd together. The
|
||||
* implementation does not necessarily support PROT_EXEC or PROT_WRITE
|
||||
* without PROT_READ. The only guarantees are that no writing will be
|
||||
* allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
|
||||
*/
|
||||
|
||||
#define PROT_NONE 0x0 /* page can not be accessed */
|
||||
#define PROT_READ 0x1 /* page can be read */
|
||||
#define PROT_WRITE 0x2 /* page can be written */
|
||||
#define PROT_EXEC 0x4 /* page can be executed */
|
||||
|
||||
#define PROT_SEM 0x10 /* page may be used for atomic ops */
|
||||
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
|
||||
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end fo growsup vma */
|
||||
|
||||
/*
|
||||
* Flags for mmap
|
||||
*/
|
||||
/* 0x01 - 0x03 are defined in linux/mman.h */
|
||||
#define MAP_TYPE 0x00f /* Mask for type of mapping */
|
||||
#define MAP_FIXED 0x010 /* Interpret addr exactly */
|
||||
|
||||
/* not used by linux, but here to make sure we don't clash with ABI defines */
|
||||
#define MAP_RENAME 0x020 /* Assign page to file */
|
||||
#define MAP_AUTOGROW 0x040 /* File may grow by writing */
|
||||
#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
|
||||
#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
|
||||
|
||||
/* These are linux-specific */
|
||||
#define MAP_NORESERVE 0x0400 /* don't check for reservations */
|
||||
#define MAP_ANONYMOUS 0x0800 /* don't use a file */
|
||||
#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
|
||||
#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
|
||||
#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
|
||||
#define MAP_LOCKED 0x8000 /* pages are locked */
|
||||
#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
|
||||
#define MAP_NONBLOCK 0x20000 /* do not block on IO */
|
||||
#define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */
|
||||
#define MAP_HUGETLB 0x80000 /* create a huge page mapping */
|
||||
#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
|
||||
#define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be
|
||||
* uninitialized */
|
||||
|
||||
/*
|
||||
* Flags for msync
|
||||
*/
|
||||
#define MS_ASYNC 0x0001 /* sync memory asynchronously */
|
||||
#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
|
||||
#define MS_SYNC 0x0004 /* synchronous memory sync */
|
||||
|
||||
/*
|
||||
* Flags for mlockall
|
||||
*/
|
||||
#define MCL_CURRENT 1 /* lock all current mappings */
|
||||
#define MCL_FUTURE 2 /* lock all future mappings */
|
||||
#define MCL_ONFAULT 4 /* lock all pages that are faulted in */
|
||||
|
||||
/*
|
||||
* Flags for mlock
|
||||
*/
|
||||
#define MLOCK_ONFAULT 0x01 /* Lock pages in range after they are faulted in, do not prefault */
|
||||
|
||||
#define MADV_NORMAL 0 /* no further special treatment */
|
||||
#define MADV_RANDOM 1 /* expect random page references */
|
||||
#define MADV_SEQUENTIAL 2 /* expect sequential page references */
|
||||
#define MADV_WILLNEED 3 /* will need these pages */
|
||||
#define MADV_DONTNEED 4 /* don't need these pages */
|
||||
|
||||
/* common parameters: try to keep these consistent across architectures */
|
||||
#define MADV_FREE 8 /* free pages only if memory pressure */
|
||||
#define MADV_REMOVE 9 /* remove these pages & resources */
|
||||
#define MADV_DONTFORK 10 /* don't inherit across fork */
|
||||
#define MADV_DOFORK 11 /* do inherit across fork */
|
||||
|
||||
#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
|
||||
#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
|
||||
|
||||
#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
|
||||
#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
|
||||
|
||||
#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
|
||||
overrides the coredump filter bits */
|
||||
#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */
|
||||
|
||||
#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
|
||||
#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
|
||||
|
||||
#define MADV_COLD 20 /* deactivate these pages */
|
||||
#define MADV_PAGEOUT 21 /* reclaim these pages */
|
||||
|
||||
#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
|
||||
#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */
|
||||
|
||||
#define MADV_DONTNEED_LOCKED 24 /* like DONTNEED, but drop locked pages too */
|
||||
|
||||
#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
|
||||
|
||||
#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */
|
||||
#define MADV_GUARD_REMOVE 103 /* unguard range */
|
||||
|
||||
/* compatibility flags */
|
||||
#define MAP_FILE 0
|
||||
|
||||
#define PKEY_DISABLE_ACCESS 0x1
|
||||
#define PKEY_DISABLE_WRITE 0x2
|
||||
#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
|
||||
PKEY_DISABLE_WRITE)
|
||||
|
||||
#endif /* _XTENSA_MMAN_H */
|
||||
@@ -0,0 +1,50 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/msgbuf.h
|
||||
*
|
||||
* The msqid64_ds structure for the Xtensa architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General
|
||||
* Public License. See the file "COPYING" in the main directory of
|
||||
* this archive for more details.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_MSGBUF_H
|
||||
#define _XTENSA_MSGBUF_H
|
||||
|
||||
#include <asm/ipcbuf.h>
|
||||
|
||||
struct msqid64_ds {
|
||||
struct ipc64_perm msg_perm;
|
||||
#ifdef __XTENSA_EB__
|
||||
unsigned long msg_stime_high;
|
||||
unsigned long msg_stime; /* last msgsnd time */
|
||||
unsigned long msg_rtime_high;
|
||||
unsigned long msg_rtime; /* last msgrcv time */
|
||||
unsigned long msg_ctime_high;
|
||||
unsigned long msg_ctime; /* last change time */
|
||||
#elif defined(__XTENSA_EL__)
|
||||
unsigned long msg_stime; /* last msgsnd time */
|
||||
unsigned long msg_stime_high;
|
||||
unsigned long msg_rtime; /* last msgrcv time */
|
||||
unsigned long msg_rtime_high;
|
||||
unsigned long msg_ctime; /* last change time */
|
||||
unsigned long msg_ctime_high;
|
||||
#else
|
||||
# error processor byte order undefined!
|
||||
#endif
|
||||
unsigned long msg_cbytes; /* current number of bytes on queue */
|
||||
unsigned long msg_qnum; /* number of messages in queue */
|
||||
unsigned long msg_qbytes; /* max number of bytes on queue */
|
||||
__kernel_pid_t msg_lspid; /* pid of last msgsnd */
|
||||
__kernel_pid_t msg_lrpid; /* last receive pid */
|
||||
unsigned long __unused4;
|
||||
unsigned long __unused5;
|
||||
};
|
||||
|
||||
#endif /* _XTENSA_MSGBUF_H */
|
||||
@@ -0,0 +1,29 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/param.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PARAM_H
|
||||
#define _XTENSA_PARAM_H
|
||||
|
||||
# define HZ 100
|
||||
|
||||
#define EXEC_PAGESIZE 4096
|
||||
|
||||
#ifndef NGROUPS
|
||||
#define NGROUPS 32
|
||||
#endif
|
||||
|
||||
#ifndef NOGROUP
|
||||
#define NOGROUP (-1)
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 64 /* max length of hostname */
|
||||
|
||||
#endif /* _XTENSA_PARAM_H */
|
||||
@@ -0,0 +1,21 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/poll.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General
|
||||
* Public License. See the file "COPYING" in the main directory of
|
||||
* this archive for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_POLL_H
|
||||
#define _XTENSA_POLL_H
|
||||
|
||||
#define POLLWRNORM POLLOUT
|
||||
#define POLLWRBAND 0x0100
|
||||
#define POLLREMOVE 0x0800
|
||||
|
||||
#include <asm-generic/poll.h>
|
||||
|
||||
#endif /* _XTENSA_POLL_H */
|
||||
@@ -0,0 +1,40 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/posix_types.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Largely copied from include/asm-ppc/posix_types.h
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_POSIX_TYPES_H
|
||||
#define _XTENSA_POSIX_TYPES_H
|
||||
|
||||
/*
|
||||
* This file is generally used by user-level software, so you need to
|
||||
* be a little careful about namespace pollution etc. Also, we cannot
|
||||
* assume GCC is being used.
|
||||
*/
|
||||
|
||||
typedef unsigned short __kernel_ipc_pid_t;
|
||||
#define __kernel_ipc_pid_t __kernel_ipc_pid_t
|
||||
|
||||
typedef unsigned int __kernel_size_t;
|
||||
typedef int __kernel_ssize_t;
|
||||
typedef long __kernel_ptrdiff_t;
|
||||
#define __kernel_size_t __kernel_size_t
|
||||
|
||||
typedef unsigned short __kernel_old_uid_t;
|
||||
typedef unsigned short __kernel_old_gid_t;
|
||||
#define __kernel_old_uid_t __kernel_old_uid_t
|
||||
|
||||
typedef unsigned short __kernel_old_dev_t;
|
||||
#define __kernel_old_dev_t __kernel_old_dev_t
|
||||
|
||||
#include <asm-generic/posix_types.h>
|
||||
|
||||
#endif /* _XTENSA_POSIX_TYPES_H */
|
||||
@@ -0,0 +1,63 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/ptrace.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PTRACE_H
|
||||
#define _XTENSA_PTRACE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* Registers used by strace */
|
||||
|
||||
#define REG_A_BASE 0x0000
|
||||
#define REG_AR_BASE 0x0100
|
||||
#define REG_PC 0x0020
|
||||
#define REG_PS 0x02e6
|
||||
#define REG_WB 0x0248
|
||||
#define REG_WS 0x0249
|
||||
#define REG_LBEG 0x0200
|
||||
#define REG_LEND 0x0201
|
||||
#define REG_LCOUNT 0x0202
|
||||
#define REG_SAR 0x0203
|
||||
|
||||
#define SYSCALL_NR 0x00ff
|
||||
|
||||
/* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
|
||||
|
||||
#define PTRACE_GETREGS 12
|
||||
#define PTRACE_SETREGS 13
|
||||
#define PTRACE_GETXTREGS 18
|
||||
#define PTRACE_SETXTREGS 19
|
||||
#define PTRACE_GETHBPREGS 20
|
||||
#define PTRACE_SETHBPREGS 21
|
||||
#define PTRACE_GETFDPIC 22
|
||||
|
||||
#define PTRACE_GETFDPIC_EXEC 0
|
||||
#define PTRACE_GETFDPIC_INTERP 1
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct user_pt_regs {
|
||||
__u32 pc;
|
||||
__u32 ps;
|
||||
__u32 lbeg;
|
||||
__u32 lend;
|
||||
__u32 lcount;
|
||||
__u32 sar;
|
||||
__u32 windowstart;
|
||||
__u32 windowbase;
|
||||
__u32 threadptr;
|
||||
__u32 syscall;
|
||||
__u32 reserved[6 + 48];
|
||||
__u32 a[64];
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* _XTENSA_PTRACE_H */
|
||||
@@ -0,0 +1,45 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/sembuf.h
|
||||
*
|
||||
* The semid64_ds structure for Xtensa architecture.
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SEMBUF_H
|
||||
#define _XTENSA_SEMBUF_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <asm/ipcbuf.h>
|
||||
|
||||
struct semid64_ds {
|
||||
struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
|
||||
#ifdef __XTENSA_EL__
|
||||
unsigned long sem_otime; /* last semop time */
|
||||
unsigned long sem_otime_high;
|
||||
unsigned long sem_ctime; /* last change time */
|
||||
unsigned long sem_ctime_high;
|
||||
#else
|
||||
unsigned long sem_otime_high;
|
||||
unsigned long sem_otime; /* last semop time */
|
||||
unsigned long sem_ctime_high;
|
||||
unsigned long sem_ctime; /* last change time */
|
||||
#endif
|
||||
unsigned long sem_nsems; /* no. of semaphores in array */
|
||||
unsigned long __unused3;
|
||||
unsigned long __unused4;
|
||||
};
|
||||
|
||||
#endif /* __ASM_XTENSA_SEMBUF_H */
|
||||
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/setup.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SETUP_H
|
||||
#define _XTENSA_SETUP_H
|
||||
|
||||
#define COMMAND_LINE_SIZE 256
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,54 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/shmbuf.h
|
||||
*
|
||||
* The shmid64_ds structure for Xtensa architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space, but the padding is on the wrong
|
||||
* side for big-endian xtensa, for historic reasons.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SHMBUF_H
|
||||
#define _XTENSA_SHMBUF_H
|
||||
|
||||
#include <asm/ipcbuf.h>
|
||||
#include <asm/posix_types.h>
|
||||
|
||||
struct shmid64_ds {
|
||||
struct ipc64_perm shm_perm; /* operation perms */
|
||||
__kernel_size_t shm_segsz; /* size of segment (bytes) */
|
||||
unsigned long shm_atime; /* last attach time */
|
||||
unsigned long shm_atime_high;
|
||||
unsigned long shm_dtime; /* last detach time */
|
||||
unsigned long shm_dtime_high;
|
||||
unsigned long shm_ctime; /* last change time */
|
||||
unsigned long shm_ctime_high;
|
||||
__kernel_pid_t shm_cpid; /* pid of creator */
|
||||
__kernel_pid_t shm_lpid; /* pid of last operator */
|
||||
unsigned long shm_nattch; /* no. of current attaches */
|
||||
unsigned long __unused4;
|
||||
unsigned long __unused5;
|
||||
};
|
||||
|
||||
struct shminfo64 {
|
||||
unsigned long shmmax;
|
||||
unsigned long shmmin;
|
||||
unsigned long shmmni;
|
||||
unsigned long shmseg;
|
||||
unsigned long shmall;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
unsigned long __unused3;
|
||||
unsigned long __unused4;
|
||||
};
|
||||
|
||||
#endif /* _XTENSA_SHMBUF_H */
|
||||
@@ -0,0 +1,29 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/sigcontext.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2007 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SIGCONTEXT_H
|
||||
#define _XTENSA_SIGCONTEXT_H
|
||||
|
||||
|
||||
struct sigcontext {
|
||||
unsigned long sc_pc;
|
||||
unsigned long sc_ps;
|
||||
unsigned long sc_lbeg;
|
||||
unsigned long sc_lend;
|
||||
unsigned long sc_lcount;
|
||||
unsigned long sc_sar;
|
||||
unsigned long sc_acclo;
|
||||
unsigned long sc_acchi;
|
||||
unsigned long sc_a[16];
|
||||
void *sc_xtregs;
|
||||
};
|
||||
|
||||
#endif /* _XTENSA_SIGCONTEXT_H */
|
||||
@@ -0,0 +1,108 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/signal.h
|
||||
*
|
||||
* Swiped from SH.
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SIGNAL_H
|
||||
#define _XTENSA_SIGNAL_H
|
||||
|
||||
|
||||
#define _NSIG 64
|
||||
#define _NSIG_BPW 32
|
||||
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* Avoid too many header ordering problems. */
|
||||
struct siginfo;
|
||||
typedef unsigned long old_sigset_t; /* at least 32 bits */
|
||||
typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
#endif
|
||||
|
||||
#define SIGHUP 1
|
||||
#define SIGINT 2
|
||||
#define SIGQUIT 3
|
||||
#define SIGILL 4
|
||||
#define SIGTRAP 5
|
||||
#define SIGABRT 6
|
||||
#define SIGIOT 6
|
||||
#define SIGBUS 7
|
||||
#define SIGFPE 8
|
||||
#define SIGKILL 9
|
||||
#define SIGUSR1 10
|
||||
#define SIGSEGV 11
|
||||
#define SIGUSR2 12
|
||||
#define SIGPIPE 13
|
||||
#define SIGALRM 14
|
||||
#define SIGTERM 15
|
||||
#define SIGSTKFLT 16
|
||||
#define SIGCHLD 17
|
||||
#define SIGCONT 18
|
||||
#define SIGSTOP 19
|
||||
#define SIGTSTP 20
|
||||
#define SIGTTIN 21
|
||||
#define SIGTTOU 22
|
||||
#define SIGURG 23
|
||||
#define SIGXCPU 24
|
||||
#define SIGXFSZ 25
|
||||
#define SIGVTALRM 26
|
||||
#define SIGPROF 27
|
||||
#define SIGWINCH 28
|
||||
#define SIGIO 29
|
||||
#define SIGPOLL SIGIO
|
||||
/* #define SIGLOST 29 */
|
||||
#define SIGPWR 30
|
||||
#define SIGSYS 31
|
||||
#define SIGUNUSED 31
|
||||
|
||||
/* These should not be considered constants from userland. */
|
||||
#define SIGRTMIN 32
|
||||
#define SIGRTMAX (_NSIG-1)
|
||||
|
||||
#define SA_RESTORER 0x04000000
|
||||
|
||||
#define MINSIGSTKSZ 2048
|
||||
#define SIGSTKSZ 8192
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <asm-generic/signal-defs.h>
|
||||
|
||||
|
||||
/* Here we must cater to libcs that poke about in kernel headers. */
|
||||
|
||||
struct sigaction {
|
||||
union {
|
||||
__sighandler_t _sa_handler;
|
||||
void (*_sa_sigaction)(int, struct siginfo *, void *);
|
||||
} _u;
|
||||
sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
void (*sa_restorer)(void);
|
||||
};
|
||||
|
||||
#define sa_handler _u._sa_handler
|
||||
#define sa_sigaction _u._sa_sigaction
|
||||
|
||||
|
||||
typedef struct sigaltstack {
|
||||
void *ss_sp;
|
||||
int ss_flags;
|
||||
__kernel_size_t ss_size;
|
||||
} stack_t;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _XTENSA_SIGNAL_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/sockios.h
|
||||
*
|
||||
* Socket-level I/O control calls. Copied from MIPS.
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1995 by Ralf Baechle
|
||||
* Copyright (C) 2001 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SOCKIOS_H
|
||||
#define _XTENSA_SOCKIOS_H
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
/* Socket-level I/O control calls. */
|
||||
|
||||
#define FIOGETOWN _IOR('f', 123, int)
|
||||
#define FIOSETOWN _IOW('f', 124, int)
|
||||
|
||||
#define SIOCATMARK _IOR('s', 7, int)
|
||||
#define SIOCSPGRP _IOW('s', 8, pid_t)
|
||||
#define SIOCGPGRP _IOR('s', 9, pid_t)
|
||||
|
||||
#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif /* _XTENSA_SOCKIOS_H */
|
||||
@@ -0,0 +1,60 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/stat.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2007 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_STAT_H
|
||||
#define _XTENSA_STAT_H
|
||||
|
||||
#define STAT_HAVE_NSEC 1
|
||||
|
||||
struct stat {
|
||||
unsigned long st_dev;
|
||||
unsigned long st_ino;
|
||||
unsigned int st_mode;
|
||||
unsigned int st_nlink;
|
||||
unsigned int st_uid;
|
||||
unsigned int st_gid;
|
||||
unsigned long st_rdev;
|
||||
long st_size;
|
||||
unsigned long st_blksize;
|
||||
unsigned long st_blocks;
|
||||
unsigned long st_atime;
|
||||
unsigned long st_atime_nsec;
|
||||
unsigned long st_mtime;
|
||||
unsigned long st_mtime_nsec;
|
||||
unsigned long st_ctime;
|
||||
unsigned long st_ctime_nsec;
|
||||
unsigned long __unused4;
|
||||
unsigned long __unused5;
|
||||
};
|
||||
|
||||
struct stat64 {
|
||||
unsigned long long st_dev; /* Device */
|
||||
unsigned long long st_ino; /* File serial number */
|
||||
unsigned int st_mode; /* File mode. */
|
||||
unsigned int st_nlink; /* Link count. */
|
||||
unsigned int st_uid; /* User ID of the file's owner. */
|
||||
unsigned int st_gid; /* Group ID of the file's group. */
|
||||
unsigned long long st_rdev; /* Device number, if device. */
|
||||
long long st_size; /* Size of file, in bytes. */
|
||||
unsigned long st_blksize; /* Optimal block size for I/O. */
|
||||
unsigned long __unused2;
|
||||
unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
|
||||
unsigned long st_atime; /* Time of last access. */
|
||||
unsigned long st_atime_nsec;
|
||||
unsigned long st_mtime; /* Time of last modification. */
|
||||
unsigned long st_mtime_nsec;
|
||||
unsigned long st_ctime; /* Time of last status change. */
|
||||
unsigned long st_ctime_nsec;
|
||||
unsigned long __unused4;
|
||||
unsigned long __unused5;
|
||||
};
|
||||
|
||||
#endif /* _XTENSA_STAT_H */
|
||||
@@ -0,0 +1,71 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/swab.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SWAB_H
|
||||
#define _XTENSA_SWAB_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
|
||||
#define __SWAB_64_THRU_32__
|
||||
|
||||
static __inline__ __u32 __arch_swab32(__u32 x)
|
||||
{
|
||||
__u32 res;
|
||||
/* instruction sequence from Xtensa ISA release 2/2000 */
|
||||
__asm__("ssai 8 \n\t"
|
||||
"srli %0, %1, 16 \n\t"
|
||||
"src %0, %0, %1 \n\t"
|
||||
"src %0, %0, %0 \n\t"
|
||||
"src %0, %1, %0 \n"
|
||||
: "=&a" (res)
|
||||
: "a" (x)
|
||||
);
|
||||
return res;
|
||||
}
|
||||
#define __arch_swab32 __arch_swab32
|
||||
|
||||
static __inline__ __u16 __arch_swab16(__u16 x)
|
||||
{
|
||||
/* Given that 'short' values are signed (i.e., can be negative),
|
||||
* we cannot assume that the upper 16-bits of the register are
|
||||
* zero. We are careful to mask values after shifting.
|
||||
*/
|
||||
|
||||
/* There exists an anomaly between xt-gcc and xt-xcc. xt-gcc
|
||||
* inserts an extui instruction after putting this function __inline__
|
||||
* to ensure that it uses only the least-significant 16 bits of
|
||||
* the result. xt-xcc doesn't use an extui, but assumes the
|
||||
* __asm__ macro follows convention that the upper 16 bits of an
|
||||
* 'unsigned short' result are still zero. This macro doesn't
|
||||
* follow convention; indeed, it leaves garbage in the upport 16
|
||||
* bits of the register.
|
||||
|
||||
* Declaring the temporary variables 'res' and 'tmp' to be 32-bit
|
||||
* types while the return type of the function is a 16-bit type
|
||||
* forces both compilers to insert exactly one extui instruction
|
||||
* (or equivalent) to mask off the upper 16 bits. */
|
||||
|
||||
__u32 res;
|
||||
__u32 tmp;
|
||||
|
||||
__asm__("extui %1, %2, 8, 8\n\t"
|
||||
"slli %0, %2, 8 \n\t"
|
||||
"or %0, %0, %1 \n"
|
||||
: "=&a" (res), "=&a" (tmp)
|
||||
: "a" (x)
|
||||
);
|
||||
|
||||
return res;
|
||||
}
|
||||
#define __arch_swab16 __arch_swab16
|
||||
|
||||
#endif /* _XTENSA_SWAB_H */
|
||||
@@ -0,0 +1,30 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* include/asm-xtensa/types.h
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_TYPES_H
|
||||
#define _XTENSA_TYPES_H
|
||||
|
||||
#include <asm-generic/int-ll64.h>
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
# define __XTENSA_UL(x) (x)
|
||||
# define __XTENSA_UL_CONST(x) x
|
||||
#else
|
||||
# define __XTENSA_UL(x) ((unsigned long)(x))
|
||||
# define ___XTENSA_UL_CONST(x) x##UL
|
||||
# define __XTENSA_UL_CONST(x) ___XTENSA_UL_CONST(x)
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _XTENSA_TYPES_H */
|
||||
@@ -0,0 +1,26 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#ifndef _XTENSA_UNISTD_H
|
||||
#define _XTENSA_UNISTD_H
|
||||
|
||||
#include <asm/unistd_32.h>
|
||||
|
||||
#define __ARCH_WANT_SYS_OLDUMOUNT
|
||||
|
||||
/*
|
||||
* sysxtensa syscall handler
|
||||
*
|
||||
* int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused);
|
||||
* int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused);
|
||||
* int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused);
|
||||
* int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval);
|
||||
* a2 a6 a3 a4 a5
|
||||
*/
|
||||
|
||||
#define SYS_XTENSA_RESERVED 0 /* don't use this */
|
||||
#define SYS_XTENSA_ATOMIC_SET 1 /* set variable */
|
||||
#define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */
|
||||
#define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */
|
||||
#define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */
|
||||
#define SYS_XTENSA_COUNT 5 /* count */
|
||||
|
||||
#endif /* _XTENSA_UNISTD_H */
|
||||
@@ -0,0 +1,418 @@
|
||||
#ifndef _ASM_UNISTD_32_H
|
||||
#define _ASM_UNISTD_32_H
|
||||
|
||||
#define __NR_spill 0
|
||||
#define __NR_xtensa 1
|
||||
#define __NR_available4 2
|
||||
#define __NR_available5 3
|
||||
#define __NR_available6 4
|
||||
#define __NR_available7 5
|
||||
#define __NR_available8 6
|
||||
#define __NR_available9 7
|
||||
#define __NR_open 8
|
||||
#define __NR_close 9
|
||||
#define __NR_dup 10
|
||||
#define __NR_dup2 11
|
||||
#define __NR_read 12
|
||||
#define __NR_write 13
|
||||
#define __NR_select 14
|
||||
#define __NR_lseek 15
|
||||
#define __NR_poll 16
|
||||
#define __NR__llseek 17
|
||||
#define __NR_epoll_wait 18
|
||||
#define __NR_epoll_ctl 19
|
||||
#define __NR_epoll_create 20
|
||||
#define __NR_creat 21
|
||||
#define __NR_truncate 22
|
||||
#define __NR_ftruncate 23
|
||||
#define __NR_readv 24
|
||||
#define __NR_writev 25
|
||||
#define __NR_fsync 26
|
||||
#define __NR_fdatasync 27
|
||||
#define __NR_truncate64 28
|
||||
#define __NR_ftruncate64 29
|
||||
#define __NR_pread64 30
|
||||
#define __NR_pwrite64 31
|
||||
#define __NR_link 32
|
||||
#define __NR_rename 33
|
||||
#define __NR_symlink 34
|
||||
#define __NR_readlink 35
|
||||
#define __NR_mknod 36
|
||||
#define __NR_pipe 37
|
||||
#define __NR_unlink 38
|
||||
#define __NR_rmdir 39
|
||||
#define __NR_mkdir 40
|
||||
#define __NR_chdir 41
|
||||
#define __NR_fchdir 42
|
||||
#define __NR_getcwd 43
|
||||
#define __NR_chmod 44
|
||||
#define __NR_chown 45
|
||||
#define __NR_stat 46
|
||||
#define __NR_stat64 47
|
||||
#define __NR_lchown 48
|
||||
#define __NR_lstat 49
|
||||
#define __NR_lstat64 50
|
||||
#define __NR_available51 51
|
||||
#define __NR_fchmod 52
|
||||
#define __NR_fchown 53
|
||||
#define __NR_fstat 54
|
||||
#define __NR_fstat64 55
|
||||
#define __NR_flock 56
|
||||
#define __NR_access 57
|
||||
#define __NR_umask 58
|
||||
#define __NR_getdents 59
|
||||
#define __NR_getdents64 60
|
||||
#define __NR_fcntl64 61
|
||||
#define __NR_fallocate 62
|
||||
#define __NR_fadvise64_64 63
|
||||
#define __NR_utime 64
|
||||
#define __NR_utimes 65
|
||||
#define __NR_ioctl 66
|
||||
#define __NR_fcntl 67
|
||||
#define __NR_setxattr 68
|
||||
#define __NR_getxattr 69
|
||||
#define __NR_listxattr 70
|
||||
#define __NR_removexattr 71
|
||||
#define __NR_lsetxattr 72
|
||||
#define __NR_lgetxattr 73
|
||||
#define __NR_llistxattr 74
|
||||
#define __NR_lremovexattr 75
|
||||
#define __NR_fsetxattr 76
|
||||
#define __NR_fgetxattr 77
|
||||
#define __NR_flistxattr 78
|
||||
#define __NR_fremovexattr 79
|
||||
#define __NR_mmap2 80
|
||||
#define __NR_munmap 81
|
||||
#define __NR_mprotect 82
|
||||
#define __NR_brk 83
|
||||
#define __NR_mlock 84
|
||||
#define __NR_munlock 85
|
||||
#define __NR_mlockall 86
|
||||
#define __NR_munlockall 87
|
||||
#define __NR_mremap 88
|
||||
#define __NR_msync 89
|
||||
#define __NR_mincore 90
|
||||
#define __NR_madvise 91
|
||||
#define __NR_shmget 92
|
||||
#define __NR_shmat 93
|
||||
#define __NR_shmctl 94
|
||||
#define __NR_shmdt 95
|
||||
#define __NR_socket 96
|
||||
#define __NR_setsockopt 97
|
||||
#define __NR_getsockopt 98
|
||||
#define __NR_shutdown 99
|
||||
#define __NR_bind 100
|
||||
#define __NR_connect 101
|
||||
#define __NR_listen 102
|
||||
#define __NR_accept 103
|
||||
#define __NR_getsockname 104
|
||||
#define __NR_getpeername 105
|
||||
#define __NR_sendmsg 106
|
||||
#define __NR_recvmsg 107
|
||||
#define __NR_send 108
|
||||
#define __NR_recv 109
|
||||
#define __NR_sendto 110
|
||||
#define __NR_recvfrom 111
|
||||
#define __NR_socketpair 112
|
||||
#define __NR_sendfile 113
|
||||
#define __NR_sendfile64 114
|
||||
#define __NR_sendmmsg 115
|
||||
#define __NR_clone 116
|
||||
#define __NR_execve 117
|
||||
#define __NR_exit 118
|
||||
#define __NR_exit_group 119
|
||||
#define __NR_getpid 120
|
||||
#define __NR_wait4 121
|
||||
#define __NR_waitid 122
|
||||
#define __NR_kill 123
|
||||
#define __NR_tkill 124
|
||||
#define __NR_tgkill 125
|
||||
#define __NR_set_tid_address 126
|
||||
#define __NR_gettid 127
|
||||
#define __NR_setsid 128
|
||||
#define __NR_getsid 129
|
||||
#define __NR_prctl 130
|
||||
#define __NR_personality 131
|
||||
#define __NR_getpriority 132
|
||||
#define __NR_setpriority 133
|
||||
#define __NR_setitimer 134
|
||||
#define __NR_getitimer 135
|
||||
#define __NR_setuid 136
|
||||
#define __NR_getuid 137
|
||||
#define __NR_setgid 138
|
||||
#define __NR_getgid 139
|
||||
#define __NR_geteuid 140
|
||||
#define __NR_getegid 141
|
||||
#define __NR_setreuid 142
|
||||
#define __NR_setregid 143
|
||||
#define __NR_setresuid 144
|
||||
#define __NR_getresuid 145
|
||||
#define __NR_setresgid 146
|
||||
#define __NR_getresgid 147
|
||||
#define __NR_setpgid 148
|
||||
#define __NR_getpgid 149
|
||||
#define __NR_getppid 150
|
||||
#define __NR_getpgrp 151
|
||||
#define __NR_reserved152 152
|
||||
#define __NR_reserved153 153
|
||||
#define __NR_times 154
|
||||
#define __NR_acct 155
|
||||
#define __NR_sched_setaffinity 156
|
||||
#define __NR_sched_getaffinity 157
|
||||
#define __NR_capget 158
|
||||
#define __NR_capset 159
|
||||
#define __NR_ptrace 160
|
||||
#define __NR_semtimedop 161
|
||||
#define __NR_semget 162
|
||||
#define __NR_semop 163
|
||||
#define __NR_semctl 164
|
||||
#define __NR_available165 165
|
||||
#define __NR_msgget 166
|
||||
#define __NR_msgsnd 167
|
||||
#define __NR_msgrcv 168
|
||||
#define __NR_msgctl 169
|
||||
#define __NR_available170 170
|
||||
#define __NR_umount2 171
|
||||
#define __NR_mount 172
|
||||
#define __NR_swapon 173
|
||||
#define __NR_chroot 174
|
||||
#define __NR_pivot_root 175
|
||||
#define __NR_umount 176
|
||||
#define __NR_swapoff 177
|
||||
#define __NR_sync 178
|
||||
#define __NR_syncfs 179
|
||||
#define __NR_setfsuid 180
|
||||
#define __NR_setfsgid 181
|
||||
#define __NR_sysfs 182
|
||||
#define __NR_ustat 183
|
||||
#define __NR_statfs 184
|
||||
#define __NR_fstatfs 185
|
||||
#define __NR_statfs64 186
|
||||
#define __NR_fstatfs64 187
|
||||
#define __NR_setrlimit 188
|
||||
#define __NR_getrlimit 189
|
||||
#define __NR_getrusage 190
|
||||
#define __NR_futex 191
|
||||
#define __NR_gettimeofday 192
|
||||
#define __NR_settimeofday 193
|
||||
#define __NR_adjtimex 194
|
||||
#define __NR_nanosleep 195
|
||||
#define __NR_getgroups 196
|
||||
#define __NR_setgroups 197
|
||||
#define __NR_sethostname 198
|
||||
#define __NR_setdomainname 199
|
||||
#define __NR_syslog 200
|
||||
#define __NR_vhangup 201
|
||||
#define __NR_uselib 202
|
||||
#define __NR_reboot 203
|
||||
#define __NR_quotactl 204
|
||||
#define __NR_nfsservctl 205
|
||||
#define __NR__sysctl 206
|
||||
#define __NR_bdflush 207
|
||||
#define __NR_uname 208
|
||||
#define __NR_sysinfo 209
|
||||
#define __NR_init_module 210
|
||||
#define __NR_delete_module 211
|
||||
#define __NR_sched_setparam 212
|
||||
#define __NR_sched_getparam 213
|
||||
#define __NR_sched_setscheduler 214
|
||||
#define __NR_sched_getscheduler 215
|
||||
#define __NR_sched_get_priority_max 216
|
||||
#define __NR_sched_get_priority_min 217
|
||||
#define __NR_sched_rr_get_interval 218
|
||||
#define __NR_sched_yield 219
|
||||
#define __NR_available222 222
|
||||
#define __NR_restart_syscall 223
|
||||
#define __NR_sigaltstack 224
|
||||
#define __NR_rt_sigreturn 225
|
||||
#define __NR_rt_sigaction 226
|
||||
#define __NR_rt_sigprocmask 227
|
||||
#define __NR_rt_sigpending 228
|
||||
#define __NR_rt_sigtimedwait 229
|
||||
#define __NR_rt_sigqueueinfo 230
|
||||
#define __NR_rt_sigsuspend 231
|
||||
#define __NR_mq_open 232
|
||||
#define __NR_mq_unlink 233
|
||||
#define __NR_mq_timedsend 234
|
||||
#define __NR_mq_timedreceive 235
|
||||
#define __NR_mq_notify 236
|
||||
#define __NR_mq_getsetattr 237
|
||||
#define __NR_available238 238
|
||||
#define __NR_io_setup 239
|
||||
#define __NR_io_destroy 240
|
||||
#define __NR_io_submit 241
|
||||
#define __NR_io_getevents 242
|
||||
#define __NR_io_cancel 243
|
||||
#define __NR_clock_settime 244
|
||||
#define __NR_clock_gettime 245
|
||||
#define __NR_clock_getres 246
|
||||
#define __NR_clock_nanosleep 247
|
||||
#define __NR_timer_create 248
|
||||
#define __NR_timer_delete 249
|
||||
#define __NR_timer_settime 250
|
||||
#define __NR_timer_gettime 251
|
||||
#define __NR_timer_getoverrun 252
|
||||
#define __NR_reserved253 253
|
||||
#define __NR_lookup_dcookie 254
|
||||
#define __NR_available255 255
|
||||
#define __NR_add_key 256
|
||||
#define __NR_request_key 257
|
||||
#define __NR_keyctl 258
|
||||
#define __NR_available259 259
|
||||
#define __NR_readahead 260
|
||||
#define __NR_remap_file_pages 261
|
||||
#define __NR_migrate_pages 262
|
||||
#define __NR_mbind 263
|
||||
#define __NR_get_mempolicy 264
|
||||
#define __NR_set_mempolicy 265
|
||||
#define __NR_unshare 266
|
||||
#define __NR_move_pages 267
|
||||
#define __NR_splice 268
|
||||
#define __NR_tee 269
|
||||
#define __NR_vmsplice 270
|
||||
#define __NR_available271 271
|
||||
#define __NR_pselect6 272
|
||||
#define __NR_ppoll 273
|
||||
#define __NR_epoll_pwait 274
|
||||
#define __NR_epoll_create1 275
|
||||
#define __NR_inotify_init 276
|
||||
#define __NR_inotify_add_watch 277
|
||||
#define __NR_inotify_rm_watch 278
|
||||
#define __NR_inotify_init1 279
|
||||
#define __NR_getcpu 280
|
||||
#define __NR_kexec_load 281
|
||||
#define __NR_ioprio_set 282
|
||||
#define __NR_ioprio_get 283
|
||||
#define __NR_set_robust_list 284
|
||||
#define __NR_get_robust_list 285
|
||||
#define __NR_available286 286
|
||||
#define __NR_available287 287
|
||||
#define __NR_openat 288
|
||||
#define __NR_mkdirat 289
|
||||
#define __NR_mknodat 290
|
||||
#define __NR_unlinkat 291
|
||||
#define __NR_renameat 292
|
||||
#define __NR_linkat 293
|
||||
#define __NR_symlinkat 294
|
||||
#define __NR_readlinkat 295
|
||||
#define __NR_utimensat 296
|
||||
#define __NR_fchownat 297
|
||||
#define __NR_futimesat 298
|
||||
#define __NR_fstatat64 299
|
||||
#define __NR_fchmodat 300
|
||||
#define __NR_faccessat 301
|
||||
#define __NR_available302 302
|
||||
#define __NR_available303 303
|
||||
#define __NR_signalfd 304
|
||||
#define __NR_eventfd 306
|
||||
#define __NR_recvmmsg 307
|
||||
#define __NR_setns 308
|
||||
#define __NR_signalfd4 309
|
||||
#define __NR_dup3 310
|
||||
#define __NR_pipe2 311
|
||||
#define __NR_timerfd_create 312
|
||||
#define __NR_timerfd_settime 313
|
||||
#define __NR_timerfd_gettime 314
|
||||
#define __NR_available315 315
|
||||
#define __NR_eventfd2 316
|
||||
#define __NR_preadv 317
|
||||
#define __NR_pwritev 318
|
||||
#define __NR_available319 319
|
||||
#define __NR_fanotify_init 320
|
||||
#define __NR_fanotify_mark 321
|
||||
#define __NR_process_vm_readv 322
|
||||
#define __NR_process_vm_writev 323
|
||||
#define __NR_name_to_handle_at 324
|
||||
#define __NR_open_by_handle_at 325
|
||||
#define __NR_sync_file_range2 326
|
||||
#define __NR_perf_event_open 327
|
||||
#define __NR_rt_tgsigqueueinfo 328
|
||||
#define __NR_clock_adjtime 329
|
||||
#define __NR_prlimit64 330
|
||||
#define __NR_kcmp 331
|
||||
#define __NR_finit_module 332
|
||||
#define __NR_accept4 333
|
||||
#define __NR_sched_setattr 334
|
||||
#define __NR_sched_getattr 335
|
||||
#define __NR_renameat2 336
|
||||
#define __NR_seccomp 337
|
||||
#define __NR_getrandom 338
|
||||
#define __NR_memfd_create 339
|
||||
#define __NR_bpf 340
|
||||
#define __NR_execveat 341
|
||||
#define __NR_userfaultfd 342
|
||||
#define __NR_membarrier 343
|
||||
#define __NR_mlock2 344
|
||||
#define __NR_copy_file_range 345
|
||||
#define __NR_preadv2 346
|
||||
#define __NR_pwritev2 347
|
||||
#define __NR_pkey_mprotect 348
|
||||
#define __NR_pkey_alloc 349
|
||||
#define __NR_pkey_free 350
|
||||
#define __NR_statx 351
|
||||
#define __NR_rseq 352
|
||||
#define __NR_clock_gettime64 403
|
||||
#define __NR_clock_settime64 404
|
||||
#define __NR_clock_adjtime64 405
|
||||
#define __NR_clock_getres_time64 406
|
||||
#define __NR_clock_nanosleep_time64 407
|
||||
#define __NR_timer_gettime64 408
|
||||
#define __NR_timer_settime64 409
|
||||
#define __NR_timerfd_gettime64 410
|
||||
#define __NR_timerfd_settime64 411
|
||||
#define __NR_utimensat_time64 412
|
||||
#define __NR_pselect6_time64 413
|
||||
#define __NR_ppoll_time64 414
|
||||
#define __NR_io_pgetevents_time64 416
|
||||
#define __NR_recvmmsg_time64 417
|
||||
#define __NR_mq_timedsend_time64 418
|
||||
#define __NR_mq_timedreceive_time64 419
|
||||
#define __NR_semtimedop_time64 420
|
||||
#define __NR_rt_sigtimedwait_time64 421
|
||||
#define __NR_futex_time64 422
|
||||
#define __NR_sched_rr_get_interval_time64 423
|
||||
#define __NR_pidfd_send_signal 424
|
||||
#define __NR_io_uring_setup 425
|
||||
#define __NR_io_uring_enter 426
|
||||
#define __NR_io_uring_register 427
|
||||
#define __NR_open_tree 428
|
||||
#define __NR_move_mount 429
|
||||
#define __NR_fsopen 430
|
||||
#define __NR_fsconfig 431
|
||||
#define __NR_fsmount 432
|
||||
#define __NR_fspick 433
|
||||
#define __NR_pidfd_open 434
|
||||
#define __NR_clone3 435
|
||||
#define __NR_close_range 436
|
||||
#define __NR_openat2 437
|
||||
#define __NR_pidfd_getfd 438
|
||||
#define __NR_faccessat2 439
|
||||
#define __NR_process_madvise 440
|
||||
#define __NR_epoll_pwait2 441
|
||||
#define __NR_mount_setattr 442
|
||||
#define __NR_quotactl_fd 443
|
||||
#define __NR_landlock_create_ruleset 444
|
||||
#define __NR_landlock_add_rule 445
|
||||
#define __NR_landlock_restrict_self 446
|
||||
#define __NR_process_mrelease 448
|
||||
#define __NR_futex_waitv 449
|
||||
#define __NR_set_mempolicy_home_node 450
|
||||
#define __NR_cachestat 451
|
||||
#define __NR_fchmodat2 452
|
||||
#define __NR_map_shadow_stack 453
|
||||
#define __NR_futex_wake 454
|
||||
#define __NR_futex_wait 455
|
||||
#define __NR_futex_requeue 456
|
||||
#define __NR_statmount 457
|
||||
#define __NR_listmount 458
|
||||
#define __NR_lsm_get_self_attr 459
|
||||
#define __NR_lsm_set_self_attr 460
|
||||
#define __NR_lsm_list_modules 461
|
||||
#define __NR_mseal 462
|
||||
#define __NR_setxattrat 463
|
||||
#define __NR_getxattrat 464
|
||||
#define __NR_listxattrat 465
|
||||
#define __NR_removexattrat 466
|
||||
|
||||
|
||||
#endif /* _ASM_UNISTD_32_H */
|
||||
43
tools/zig-x86_64-windows-0.14.1/lib/libc/mingw/COPYING
Normal file
43
tools/zig-x86_64-windows-0.14.1/lib/libc/mingw/COPYING
Normal file
@@ -0,0 +1,43 @@
|
||||
With exception of certain parts that are prominently marked as being
|
||||
in the Public Domain, BSD, or LGPL this Software is provided under the
|
||||
Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009 - 2013 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the mingw-w64 runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
// This source file defines the function pointers required to support Control
|
||||
// Flow Guard. They shall be included even if CFGuard is disabled when building
|
||||
// mingw-w64-crt itself, to allow linking to objects/libraries compiled with
|
||||
// CFGuard.
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
// The target address is passed as a parameter in an arch-specific manner,
|
||||
// however it is not specified how on x86_64 because __guard_dispatch_icall_fptr
|
||||
// is used instead. My guess would be that it's passed on %rcx, but it doesn't
|
||||
// really matter here because this is a no-op anyway.
|
||||
static void __guard_check_icall_dummy(void) {}
|
||||
|
||||
// When CFGuard is not active, directly tail-call the target address, which
|
||||
// is passed via %rax.
|
||||
__asm__(
|
||||
".globl __guard_dispatch_icall_dummy\n"
|
||||
"__guard_dispatch_icall_dummy:\n"
|
||||
" jmp *%rax\n"
|
||||
);
|
||||
|
||||
// This is intentionally declared as _not_ a function pointer, so that the
|
||||
// jmp instruction is not included as a valid call target for CFGuard.
|
||||
extern void *__guard_dispatch_icall_dummy;
|
||||
|
||||
#elif defined(__i386__) || defined(__aarch64__) || defined(__arm__)
|
||||
|
||||
// The target address is passed via %ecx (x86), X15 (aarch64) or R0 (arm),
|
||||
// but it doesn't really matter here because this is a no-op anyway.
|
||||
static void __guard_check_icall_dummy(void) {}
|
||||
|
||||
#else
|
||||
# error "CFGuard support is unimplemented for the current architecture."
|
||||
#endif
|
||||
|
||||
// I am not sure about the `.00cfg` section. This is just an attempt to follow
|
||||
// what VC runtime defines -- it places all the guard check function pointers
|
||||
// inside this section. The MSVC linker appears to merge this section into
|
||||
// `.rdata`, but LLD does not do this at the time of writing.
|
||||
// This section should be readonly data. The only thing that modifies these
|
||||
// pointers is the PE image loader.
|
||||
|
||||
__asm__(".section .00cfg,\"dr\"");
|
||||
|
||||
__attribute__(( section (".00cfg") ))
|
||||
void *__guard_check_icall_fptr = &__guard_check_icall_dummy;
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
__attribute__(( section (".00cfg") ))
|
||||
void *__guard_dispatch_icall_fptr = &__guard_dispatch_icall_dummy;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <complex.h>
|
||||
|
||||
/* We implement this function to make sure we use always the C99 compatible
|
||||
routine. By this we fix an issue about 32-bit and 64-bit version of
|
||||
msvcrt, which differs in some corner-cases. */
|
||||
|
||||
double __cdecl
|
||||
_cabs (struct _complex _ComplexA)
|
||||
{
|
||||
double _Complex a;
|
||||
|
||||
__real__ a = _ComplexA.x;
|
||||
__imag__ a = _ComplexA.y;
|
||||
|
||||
return cabs (a);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* double version of the functions. */
|
||||
#define _NEW_COMPLEX_DOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
#include "cabs.def.h"
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __cdecl
|
||||
__FLT_ABI(cabs) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
return __FLT_ABI(hypot) (__real__ z, __imag__ z);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Float version of the functions. */
|
||||
#define _NEW_COMPLEX_FLOAT 1
|
||||
#include "complex_internal.h"
|
||||
#include "cabs.def.h"
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* long double version of the functions. */
|
||||
#define _NEW_COMPLEX_LDOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
#include "cabs.def.h"
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* double version of the functions. */
|
||||
#define _NEW_COMPLEX_DOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "cacosh.def.h"
|
||||
#include "cacos.def.h"
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __complex__ __cdecl
|
||||
__FLT_ABI(cacos) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
__complex__ __FLT_TYPE x;
|
||||
__complex__ __FLT_TYPE ret;
|
||||
|
||||
x = __FLT_ABI(casin) (z);
|
||||
|
||||
__real__ ret = (__FLT_TYPE) __FLT_PI_2 - __real__ x;
|
||||
__imag__ ret = -__imag__ x;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Float version of the functions. */
|
||||
#define _NEW_COMPLEX_FLOAT 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "cacosh.def.h"
|
||||
#include "cacos.def.h"
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __complex__ __cdecl
|
||||
__FLT_ABI(cacosh) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
__complex__ __FLT_TYPE ret;
|
||||
__complex__ __FLT_TYPE x;
|
||||
int r_class = fpclassify (__real__ z);
|
||||
int i_class = fpclassify (__imag__ z);
|
||||
|
||||
if (i_class == FP_INFINITE)
|
||||
{
|
||||
__real__ ret = __FLT_HUGE_VAL;
|
||||
__imag__ ret = (r_class == FP_NAN ? __FLT_NAN : __FLT_ABI(copysign) (
|
||||
(r_class == FP_INFINITE ? (__real__ z < __FLT_CST(0.0) ? __FLT_PI_3_4 : __FLT_PI_4) : __FLT_PI_2), __imag__ z));
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_INFINITE)
|
||||
{
|
||||
__real__ ret = __FLT_HUGE_VAL;
|
||||
__imag__ ret = ((i_class != FP_NAN && i_class != FP_INFINITE)
|
||||
? __FLT_ABI(copysign) (signbit (__real__ z) ? __FLT_PI : __FLT_CST(0.0), __imag__ z) : __FLT_NAN);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_NAN || i_class == FP_NAN)
|
||||
{
|
||||
__real__ ret = __FLT_NAN;
|
||||
__imag__ ret = __FLT_NAN;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_ZERO && i_class == FP_ZERO)
|
||||
{
|
||||
__real__ ret = __FLT_CST(0.0);
|
||||
__imag__ ret = __FLT_ABI(copysign) (__FLT_PI_2, __imag__ z);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* cacosh(z) = log(z + sqrt(z*z - 1)) */
|
||||
|
||||
if (__FLT_ABI(fabs) (__real__ z) >= __FLT_CST(1.0)/__FLT_EPSILON
|
||||
|| __FLT_ABI(fabs) (__imag__ z) >= __FLT_CST(1.0)/__FLT_EPSILON)
|
||||
{
|
||||
/* For large z, z + sqrt(z*z - 1) is approximately 2*z.
|
||||
Use that approximation to avoid overflow when squaring.
|
||||
Additionally, use symmetries to perform the calculation in the positive
|
||||
half plane. */
|
||||
__real__ x = __real__ z;
|
||||
__imag__ x = __FLT_ABI(fabs) (__imag__ z);
|
||||
x = __FLT_ABI(clog) (x);
|
||||
__real__ x += M_LN2;
|
||||
|
||||
/* adjust signs for input */
|
||||
__real__ ret = __real__ x;
|
||||
__imag__ ret = __FLT_ABI(copysign) (__imag__ x, __imag__ z);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
__real__ x = (__real__ z - __imag__ z) * (__real__ z + __imag__ z) - __FLT_CST(1.0);
|
||||
__imag__ x = __FLT_CST(2.0) * __real__ z * __imag__ z;
|
||||
|
||||
x = __FLT_ABI(csqrt) (x);
|
||||
|
||||
if (signbit (__real__ z))
|
||||
x = -x;
|
||||
|
||||
__real__ x += __real__ z;
|
||||
__imag__ x += __imag__ z;
|
||||
|
||||
ret = __FLT_ABI(clog) (x);
|
||||
|
||||
if (signbit (__real__ ret))
|
||||
ret = -ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* long double version of the functions. */
|
||||
#define _NEW_COMPLEX_LDOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "cacosh.def.h"
|
||||
#include "cacos.def.h"
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* double version of the functions. */
|
||||
#define _NEW_COMPLEX_DOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
#include "carg.def.h"
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __cdecl
|
||||
__FLT_ABI(carg) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
return __FLT_ABI(atan2) (__imag__ z, __real__ z);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Float version of the functions. */
|
||||
#define _NEW_COMPLEX_FLOAT 1
|
||||
#include "complex_internal.h"
|
||||
#include "carg.def.h"
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* long double version of the functions. */
|
||||
#define _NEW_COMPLEX_LDOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
#include "carg.def.h"
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* double version of the functions. */
|
||||
#define _NEW_COMPLEX_DOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "casinh.def.h"
|
||||
#include "casin.def.h"
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __complex__ __cdecl
|
||||
__FLT_ABI(casin) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
/* Annex G.6: casin(z) = -i casinh (iz) */
|
||||
__complex__ __FLT_TYPE ret;
|
||||
__complex__ __FLT_TYPE x;
|
||||
|
||||
__real__ x = -__imag__ z;
|
||||
__imag__ x = __real__ z;
|
||||
|
||||
x = __FLT_ABI(casinh) (x);
|
||||
|
||||
__real__ ret = __imag__ x;
|
||||
__imag__ ret = -__real__ x;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Float version of the functions. */
|
||||
#define _NEW_COMPLEX_FLOAT 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "casinh.def.h"
|
||||
#include "casin.def.h"
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __complex__ __cdecl
|
||||
__FLT_ABI(casinh) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
__complex__ __FLT_TYPE ret;
|
||||
__complex__ __FLT_TYPE x;
|
||||
__FLT_TYPE arz, aiz;
|
||||
int r_class = fpclassify (__real__ z);
|
||||
int i_class = fpclassify (__imag__ z);
|
||||
|
||||
if (i_class == FP_INFINITE)
|
||||
{
|
||||
__real__ ret = __FLT_ABI(copysign) (__FLT_HUGE_VAL, __real__ z);
|
||||
__imag__ ret = (r_class == FP_NAN
|
||||
? __FLT_NAN
|
||||
: (__FLT_ABI(copysign) ((r_class != FP_NAN && r_class != FP_INFINITE) ? __FLT_PI_2 : __FLT_PI_4, __imag__ z)));
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_INFINITE)
|
||||
{
|
||||
__real__ ret = __real__ z;
|
||||
__imag__ ret = (i_class != FP_NAN
|
||||
? __FLT_ABI(copysign) (__FLT_CST(0.0), __imag__ z)
|
||||
: __FLT_NAN);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_NAN)
|
||||
{
|
||||
__real__ ret = __real__ z;
|
||||
__imag__ ret = (i_class == FP_ZERO
|
||||
? __FLT_ABI(copysign) (__FLT_CST(0.0), __imag__ z)
|
||||
: __FLT_NAN);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (i_class == FP_NAN)
|
||||
{
|
||||
__real__ ret = __FLT_NAN;
|
||||
__imag__ ret = __FLT_NAN;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_ZERO && i_class == FP_ZERO)
|
||||
return z;
|
||||
|
||||
/* casinh(z) = log(z + sqrt(z*z + 1)) */
|
||||
|
||||
/* Use symmetries to perform the calculation in the first quadrant. */
|
||||
arz = __FLT_ABI(fabs) (__real__ z);
|
||||
aiz = __FLT_ABI(fabs) (__imag__ z);
|
||||
|
||||
if (arz >= __FLT_CST(1.0)/__FLT_EPSILON
|
||||
|| aiz >= __FLT_CST(1.0)/__FLT_EPSILON)
|
||||
{
|
||||
/* For large z, z + sqrt(z*z + 1) is approximately 2*z.
|
||||
Use that approximation to avoid overflow when squaring. */
|
||||
__real__ x = arz;
|
||||
__imag__ x = aiz;
|
||||
ret = __FLT_ABI(clog) (x);
|
||||
__real__ ret += M_LN2;
|
||||
}
|
||||
else if (aiz < __FLT_CST(1.0) && arz <= __FLT_EPSILON)
|
||||
{
|
||||
/* Taylor series expansion around arz=0 for z + sqrt(z*z + 1):
|
||||
c = arz + sqrt(1-aiz^2) + i*(aiz + arz*aiz / sqrt(1-aiz^2)) + O(arz^2)
|
||||
Identity: clog(c) = log(|c|) + i*arg(c)
|
||||
For real part of result:
|
||||
|c| = 1 + arz / sqrt(1-aiz^2) + O(arz^2) (Taylor series expansion)
|
||||
For imaginary part of result:
|
||||
c = (arz + sqrt(1-aiz^2))/sqrt(1-aiz^2) * (sqrt(1-aiz^2) + i*aiz) + O(arz^6)
|
||||
*/
|
||||
__FLT_TYPE s1maiz2 = __FLT_ABI(sqrt) ((__FLT_CST(1.0)+aiz)*(__FLT_CST(1.0)-aiz));
|
||||
__real__ ret = __FLT_ABI(log1p) (arz / s1maiz2);
|
||||
__imag__ ret = __FLT_ABI(atan2) (aiz, s1maiz2);
|
||||
}
|
||||
else if (aiz < __FLT_CST(1.0) && arz*arz <= __FLT_EPSILON)
|
||||
{
|
||||
/* Taylor series expansion around arz=0 for z + sqrt(z*z + 1):
|
||||
c = arz + sqrt(1-aiz^2) + arz^2 / (2*(1-aiz^2)^(3/2)) + i*(aiz + arz*aiz / sqrt(1-aiz^2)) + O(arz^4)
|
||||
Identity: clog(c) = log(|c|) + i*arg(c)
|
||||
For real part of result:
|
||||
|c| = 1 + arz / sqrt(1-aiz^2) + arz^2/(2*(1-aiz^2)) + O(arz^3) (Taylor series expansion)
|
||||
For imaginary part of result:
|
||||
c = 1/sqrt(1-aiz^2) * ((1-aiz^2) + arz*sqrt(1-aiz^2) + arz^2/(2*(1-aiz^2)) + i*aiz*(sqrt(1-aiz^2)+arz)) + O(arz^3)
|
||||
*/
|
||||
__FLT_TYPE onemaiz2 = (__FLT_CST(1.0)+aiz)*(__FLT_CST(1.0)-aiz);
|
||||
__FLT_TYPE s1maiz2 = __FLT_ABI(sqrt) (onemaiz2);
|
||||
__FLT_TYPE arz2red = arz * arz / __FLT_CST(2.0) / s1maiz2;
|
||||
__real__ ret = __FLT_ABI(log1p) ((arz + arz2red) / s1maiz2);
|
||||
__imag__ ret = __FLT_ABI(atan2) (aiz * (s1maiz2 + arz),
|
||||
onemaiz2 + arz*s1maiz2 + arz2red);
|
||||
}
|
||||
else
|
||||
{
|
||||
__real__ x = (arz - aiz) * (arz + aiz) + __FLT_CST(1.0);
|
||||
__imag__ x = __FLT_CST(2.0) * arz * aiz;
|
||||
|
||||
x = __FLT_ABI(csqrt) (x);
|
||||
|
||||
__real__ x += arz;
|
||||
__imag__ x += aiz;
|
||||
|
||||
ret = __FLT_ABI(clog) (x);
|
||||
}
|
||||
|
||||
/* adjust signs for input quadrant */
|
||||
__real__ ret = __FLT_ABI(copysign) (__real__ ret, __real__ z);
|
||||
__imag__ ret = __FLT_ABI(copysign) (__imag__ ret, __imag__ z);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* long double version of the functions. */
|
||||
#define _NEW_COMPLEX_LDOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "casinh.def.h"
|
||||
#include "casin.def.h"
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* double version of the functions. */
|
||||
#define _NEW_COMPLEX_DOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "catanh.def.h"
|
||||
#include "catan.def.h"
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __complex__ __cdecl
|
||||
__FLT_ABI(catan) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
/* Annex G.6: catan(z) = -i catanh (iz) */
|
||||
__complex__ __FLT_TYPE ret;
|
||||
__complex__ __FLT_TYPE x;
|
||||
|
||||
__real__ x = -__imag__ z;
|
||||
__imag__ x = __real__ z;
|
||||
|
||||
x = __FLT_ABI(catanh) (x);
|
||||
|
||||
__real__ ret = __imag__ x;
|
||||
__imag__ ret = -__real__ x;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Float version of the functions. */
|
||||
#define _NEW_COMPLEX_FLOAT 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "catanh.def.h"
|
||||
#include "catan.def.h"
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
__FLT_TYPE __complex__ __cdecl
|
||||
__FLT_ABI(catanh) (__FLT_TYPE __complex__ z)
|
||||
{
|
||||
__complex__ __FLT_TYPE ret;
|
||||
__FLT_TYPE i2, n, d;
|
||||
int r_class = fpclassify (__real__ z);
|
||||
int i_class = fpclassify (__imag__ z);
|
||||
|
||||
if (r_class == FP_INFINITE || r_class == FP_NAN || i_class == FP_INFINITE || i_class == FP_NAN)
|
||||
{
|
||||
if (i_class == FP_INFINITE)
|
||||
{
|
||||
__real__ ret = __FLT_ABI(copysign) (__FLT_CST(0.0), __real__ z);
|
||||
__imag__ ret = __FLT_ABI(copysign) (__FLT_PI_2, __imag__ z);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_INFINITE || r_class == FP_ZERO)
|
||||
{
|
||||
__real__ ret = __FLT_ABI(copysign) (__FLT_CST(0.0), __real__ z);
|
||||
__imag__ ret = ((i_class != FP_NAN && i_class != FP_INFINITE)
|
||||
? __FLT_ABI(copysign) (__FLT_PI_2, __imag__ z) : __FLT_NAN);
|
||||
return ret;
|
||||
}
|
||||
|
||||
__real__ ret = __FLT_NAN;
|
||||
__imag__ ret = __FLT_NAN;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_class == FP_ZERO && i_class == FP_ZERO)
|
||||
return z;
|
||||
|
||||
/* catanh(z) = 1/2 * clog(1+z) - 1/2 * clog(1-z) = 1/2 * clog((1+z)/(1-z)) */
|
||||
|
||||
/* Use identity clog(c) = 1/2*log(|c|^2) + i*arg(c) to calculate real and
|
||||
imaginary parts separately. */
|
||||
|
||||
/* real part */
|
||||
/* |c|^2 = (Im(z)^2 + (1+Re(z))^2)/(Im(z)^2 + (1-Re(z))^2) */
|
||||
i2 = __imag__ z * __imag__ z;
|
||||
|
||||
if (__FLT_ABI(fabs) (__real__ z) <= __FLT_EPSILON)
|
||||
{
|
||||
/* |c|^2 = 1 + 4*Re(z)/(1+Im(z)^2) + O(Re(z)^2) (Taylor series) */
|
||||
__real__ ret = __FLT_CST(0.25) *
|
||||
__FLT_ABI(log1p) (__FLT_CST(4.0)*(__real__ z) / (__FLT_CST(1.0) + i2));
|
||||
}
|
||||
else if ((__real__ z)*(__real__ z) <= __FLT_EPSILON)
|
||||
{
|
||||
/* |c|^2 = 1 + 4*Re(z)/(1+Im(z)^2) + 8*Re(z)^2/(1+Im(z)^2)^2 + O(Re(z)^3) (Taylor series) */
|
||||
d = __real__ z / (__FLT_CST(1.0) + i2);
|
||||
__real__ ret = __FLT_CST(0.25) *
|
||||
__FLT_ABI(log1p) (__FLT_CST(4.0) * d * (__FLT_CST(1.0) + __FLT_CST(2.0) * d));
|
||||
}
|
||||
else
|
||||
{
|
||||
n = __FLT_CST(1.0) + __real__ z;
|
||||
n = i2 + n * n;
|
||||
|
||||
d = __FLT_CST(1.0) - __real__ z;
|
||||
d = i2 + d * d;
|
||||
|
||||
__real__ ret = __FLT_CST(0.25) * (__FLT_ABI(log) (n) - __FLT_ABI(log) (d));
|
||||
}
|
||||
|
||||
/* imaginary part */
|
||||
/* z = (1 - Re(z)^2 - Im(z)^2 + 2i * Im(z) / ((1-Re(z))^2 + Im(z)^2) */
|
||||
d = __FLT_CST(1.0) - __real__ z * __real__ z - i2;
|
||||
|
||||
__imag__ ret = __FLT_CST(0.5) * __FLT_ABI(atan2) (__FLT_CST(2.0) * __imag__ z, d);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
This Software is provided under the Zope Public License (ZPL) Version 2.1.
|
||||
|
||||
Copyright (c) 2009, 2010 by the mingw-w64 project
|
||||
|
||||
See the AUTHORS file for the list of contributors to the mingw-w64 project.
|
||||
|
||||
This license has been certified as open source. It has also been designated
|
||||
as GPL compatible by the Free Software Foundation (FSF).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions in source code must retain the accompanying copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the accompanying
|
||||
copyright notice, this list of conditions, and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Names of the copyright holders must not be used to endorse or promote
|
||||
products derived from this software without prior written permission
|
||||
from the copyright holders.
|
||||
4. The right to distribute this software or to use it for any purpose does
|
||||
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
|
||||
the copyright holders. Use of them is covered by separate agreement
|
||||
with the copyright holders.
|
||||
5. If any files are modified, you must cause the modified files to carry
|
||||
prominent notices stating that you changed the files and the date of
|
||||
any change.
|
||||
|
||||
Disclaimer
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* long double version of the functions. */
|
||||
#define _NEW_COMPLEX_LDOUBLE 1
|
||||
#include "complex_internal.h"
|
||||
|
||||
#include "catanh.def.h"
|
||||
#include "catan.def.h"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user