Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/tools/include/nolibc/arch.h
26289 views
1
/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2
/*
3
* Copyright (C) 2017-2022 Willy Tarreau <[email protected]>
4
*/
5
6
/* Below comes the architecture-specific code. For each architecture, we have
7
* the syscall declarations and the _start code definition. This is the only
8
* global part. On all architectures the kernel puts everything in the stack
9
* before jumping to _start just above us, without any return address (_start
10
* is not a function but an entry point). So at the stack pointer we find argc.
11
* Then argv[] begins, and ends at the first NULL. Then we have envp which
12
* starts and ends with a NULL as well. So envp=argv+argc+1.
13
*/
14
15
#ifndef _NOLIBC_ARCH_H
16
#define _NOLIBC_ARCH_H
17
18
#if defined(__x86_64__) || defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__)
19
#include "arch-x86.h"
20
#elif defined(__ARM_EABI__)
21
#include "arch-arm.h"
22
#elif defined(__aarch64__)
23
#include "arch-arm64.h"
24
#elif defined(__mips__)
25
#include "arch-mips.h"
26
#elif defined(__powerpc__)
27
#include "arch-powerpc.h"
28
#elif defined(__riscv)
29
#include "arch-riscv.h"
30
#elif defined(__s390x__) || defined(__s390__)
31
#include "arch-s390.h"
32
#elif defined(__loongarch__)
33
#include "arch-loongarch.h"
34
#elif defined(__sparc__)
35
#include "arch-sparc.h"
36
#elif defined(__m68k__)
37
#include "arch-m68k.h"
38
#elif defined(__sh__)
39
#include "arch-sh.h"
40
#else
41
#error Unsupported Architecture
42
#endif
43
44
#endif /* _NOLIBC_ARCH_H */
45
46