arch.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * Copyright (C) 2017-2022 Willy Tarreau <[email protected]>
  4. */
  5. /* Below comes the architecture-specific code. For each architecture, we have
  6. * the syscall declarations and the _start code definition. This is the only
  7. * global part. On all architectures the kernel puts everything in the stack
  8. * before jumping to _start just above us, without any return address (_start
  9. * is not a function but an entry pint). So at the stack pointer we find argc.
  10. * Then argv[] begins, and ends at the first NULL. Then we have envp which
  11. * starts and ends with a NULL as well. So envp=argv+argc+1.
  12. */
  13. #ifndef _NOLIBC_ARCH_H
  14. #define _NOLIBC_ARCH_H
  15. #if defined(__x86_64__)
  16. #include "arch-x86_64.h"
  17. #elif defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__)
  18. #include "arch-i386.h"
  19. #elif defined(__ARM_EABI__)
  20. #include "arch-arm.h"
  21. #elif defined(__aarch64__)
  22. #include "arch-aarch64.h"
  23. #elif defined(__mips__) && defined(_ABIO32)
  24. #include "arch-mips.h"
  25. #elif defined(__riscv)
  26. #include "arch-riscv.h"
  27. #endif
  28. #endif /* _NOLIBC_ARCH_H */