What is the "linux-2.6.3x.x / include / asm-generic /" for?

My os-book says that if you want to add a system call to the Linux kernel, edit linux-2.x/include/asm-i386/unistd.h .

But the original linux kernel structure seems to have changed a lot. In the source tree of the linux-2.6.34.1 I find only linux-2.6.34.1/include/asm-generic/unistd.h and linux-2.6.34.1/arch/x86/include/asm/unistd.h .

Editing the latter seems to make sense.

My question is: what is /inlcude/asm-generic ? How can related code be shared?

+4
source share
1 answer

asm-generic are generic versions of functions, usually encoded in an assembly, but encoded in plain C without any built-in assembly. This probably simplified porting the kernel to new platforms and kept a single, common code in one place.

+4
source

Source: https://habr.com/ru/post/1315676/


All Articles