arch/x86/entry/
有两个特殊的syscall文件:
syscalls/syscall_32.tbl
和dito“ 64”
系统调用很特殊,因为内核必须将ABI和API结合在一起。
通常,include目录和其他头文件(独立的文件,如kernel / sched / sched.h)遵循分层逻辑。我认为make和gcc都可以发挥作用。
系统地使用这些符号来确保每个标头“单位”仅被读取一次。(“保护性包装纸”,因为交叉可能太多)。从这里include/linux/mm.h
:
#ifndef _LINUX_MM_H
#define _LINUX_MM_H
#include <linux/errno.h>
#ifdef __KERNEL__
... (#includes)
... (ext. decl. etc., the whole mm.h)
#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
tbl文件具有:
# 32-bit system call numbers and entry vectors
列表以以下内容开头:
0 i386 restart_syscall sys_restart_syscall __ia32_sys_restart_syscall
1 i386 exit sys_exit __ia32_sys_exit
2 i386 fork sys_fork __ia32_sys_fork
3 i386 read sys_read __ia32_sys_read
#
# 64-bit system call numbers and entry vectors
#
# The format is:
# <number> <abi> <name> <entry point>
#
# The __x64_sys_*() stubs are created on-the-fly for sys_*() system calls
#
# The abi is "common", "64" or "x32" for this file.
稍后再进行布局...