boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

syscall.h (3124B)


      1 /* -*-comment-start: "//";comment-end:""-*-
      2  * GNU Mes --- Maxwell Equations of Software
      3  * Copyright © 2018,2022,2024 Janneke Nieuwenhuizen <janneke@gnu.org>
      4  * Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
      5  *
      6  * This file is part of GNU Mes.
      7  *
      8  * GNU Mes is free software; you can redistribute it and/or modify it
      9  * under the terms of the GNU General Public License as published by
     10  * the Free Software Foundation; either version 3 of the License, or (at
     11  * your option) any later version.
     12  *
     13  * GNU Mes is distributed in the hope that it will be useful, but
     14  * WITHOUT ANY WARRANTY; without even the implied warranty of
     15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16  * GNU General Public License for more details.
     17  *
     18  * You should have received a copy of the GNU General Public License
     19  * along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
     20  */
     21 /* Commentary:
     22  *   See https://github.com/torvalds/linux/blob/v4.19/arch/arm/tools/syscall.tbl
     23  *       https://github.com/torvalds/linux/raw/v4.19/arch/arm/tools/syscall.tbl
     24  *
     25  * Code:
     26  */
     27 #ifndef __MES_LINUX_ARM_SYSCALL_H
     28 #define __MES_LINUX_ARM_SYSCALL_H 1
     29 
     30 /* libc-mini */
     31 #ifndef SYS_exit
     32 #define SYS_exit    0x01
     33 #endif
     34 #ifndef SYS_write
     35 #define SYS_write   0x04
     36 #endif
     37 
     38 /* libc */
     39 #define SYS_fork    0x02
     40 #define SYS_read    0x03
     41 #define SYS_open    0x05
     42 //#define SYS_waitpid
     43 #define SYS_wait4   0x72
     44 #define SYS_execve  0x0b
     45 #define SYS_chmod   0x0f
     46 #define SYS_access  0x21
     47 #define SYS_brk     0x2d
     48 #define SYS_ioctl   0x36
     49 #define SYS_fsync   0x76
     50 #define SYS_getcwd  0xb7
     51 #define SYS_dup     0x29
     52 #define SYS_dup2    0x3f
     53 #define SYS_unlink  0x0a
     54 #define SYS_gettimeofday 0x4e
     55 #define SYS_clock_gettime 0x107
     56 #define SYS_newuname   0x7a
     57 
     58 /* libc+tcc */
     59 #define SYS_close  0x06
     60 #define SYS_lseek  0x13
     61 #define SYS_rmdir  0x28
     62 #define SYS_stat   0x6a
     63 
     64 /* libc+gnu */
     65 #define SYS_chdir     0x0c
     66 #define SYS_link      0x09
     67 #define SYS_getpid    0x14
     68 #define SYS_getuid    0x18
     69 #define SYS_kill      0x25
     70 #define SYS_rename    0x26
     71 #define SYS_mkdir     0x27
     72 #define SYS_pipe      0x2a
     73 #define SYS_getgid    0x2f
     74 #define SYS_rt_sigaction 0xae
     75 #define SYS_rt_sigreturn 0xad
     76 #define SYS_fcntl     0x37
     77 #define SYS_getrusage 0x4d
     78 #define SYS_lstat     0x6b
     79 #define SYS_setitimer 0x68
     80 #define SYS_fstat     0x6c
     81 #define SYS_nanosleep 0xa2
     82 #define SYS_getdents  0x8d
     83 
     84 /* bash */
     85 #define SYS_setuid    0x17
     86 #define SYS_setgid    0x2e
     87 #define SYS_geteuid   0x31
     88 #define SYS_getegid   0x32
     89 #define SYS_getppid   0x40
     90 
     91 /* make+WITH_GLIBC */
     92 #define SYS_rt_sigprocmask 0xaf
     93 
     94 /* tar */
     95 #define SYS_symlink   0x53
     96 #define SYS_readlink  0x55
     97 #define SYS_mknod     0x0e
     98 
     99 /* gash */
    100 #define SYS_umask     0x3c
    101 #define SYS_utimensat 0x15c
    102 
    103 #if __SIZEOF_LONG_LONG__ == 8
    104 
    105 #define SYS_stat64     0xc3
    106 #define SYS_lstat64    0xc4
    107 #define SYS_fstat64    0xc5
    108 #define SYS_fcntl64    0xdd
    109 #define SYS_getdents64 0xdc
    110 
    111 #undef SYS_stat
    112 #define SYS_stat SYS_stat64
    113 
    114 #undef SYS_lstat
    115 #define SYS_lstat SYS_lstat64
    116 
    117 #undef SYS_fstat
    118 #define SYS_fstat SYS_fstat64
    119 
    120 #endif  // __SIZEOF_LONG_LONG__ == 8
    121 
    122 #endif /* __MES_LINUX_ARM_SYSCALL_H */