diff --git a/README.adoc b/README.adoc index 4797f78..e062d90 100644 --- a/README.adoc +++ b/README.adoc @@ -11556,16 +11556,16 @@ Not documented as of GCC 8.2, but possible: https://stackoverflow.com/questions/ The following <> programs illustrate how to make system calls: * x86_64 -** link:userland/arch/x86_64/freestanding/hello.S[] -** link:userland/arch/x86_64/c/freestanding/hello.c[] -** link:userland/arch/x86_64/c/freestanding/hello_regvar.c[] +** link:userland/arch/x86_64/freestanding/linux/hello.S[] +** link:userland/arch/x86_64/c/freestanding/linux/hello.c[] +** link:userland/arch/x86_64/c/freestanding/linux/hello_regvar.c[] * arm -** link:userland/arch/arm/freestanding/hello.S[] -** link:userland/arch/arm/c/freestanding/hello.c[] +** link:userland/arch/arm/freestanding/linux/hello.S[] +** link:userland/arch/arm/c/freestanding/linux/hello.c[] * aarch64 -** link:userland/arch/aarch64/freestanding/hello.S[] -** link:userland/arch/aarch64/c/freestanding/hello.c[] -** link:userland/arch/aarch64/c/freestanding/hello_clobbers.c[] +** link:userland/arch/aarch64/freestanding/linux/hello.S[] +** link:userland/arch/aarch64/c/freestanding/linux/hello.c[] +** link:userland/arch/aarch64/c/freestanding/linux/hello_clobbers.c[] Determining the ARM syscall numbers: @@ -11585,8 +11585,11 @@ Questions about the C inline assembly examples: === Calling conventions -* x86_64 -** link:userland/arch/x86_64/common_arch.h[] `ENTRY` and `EXIT` +==== x86_64 calling convention + +Examples: + +* link:userland/arch/x86_64/common_arch.h[] `ENTRY` and `EXIT` ==== ARM calling convention @@ -11594,10 +11597,10 @@ Call C standard library functions from assembly and vice versa. * arm ** link:userland/arch/arm/common_arch.h[] `ENTRY` and `EXIT` -** link:userland/arch/arm/c_from_asm.S[] +** link:userland/arch/arm/linux/c_from_asm.S[] * aarch64 ** link:userland/arch/aarch64/common_arch.h[] `ENTRY` and `EXIT` -** link:userland/arch/aarch64/c/asm_from_c.c[] +** link:userland/arch/aarch64/c/linux/asm_from_c.c[] ARM Architecture Procedure Call Standard (AAPCS) is the name that ARM Holdings gives to the calling convention. diff --git a/userland/arch/aarch64/c/freestanding/linux/build b/userland/arch/aarch64/c/freestanding/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/aarch64/c/freestanding/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/aarch64/c/freestanding/hello.c b/userland/arch/aarch64/c/freestanding/linux/hello.c similarity index 100% rename from userland/arch/aarch64/c/freestanding/hello.c rename to userland/arch/aarch64/c/freestanding/linux/hello.c diff --git a/userland/arch/aarch64/c/freestanding/hello_clobbers.c b/userland/arch/aarch64/c/freestanding/linux/hello_clobbers.c similarity index 100% rename from userland/arch/aarch64/c/freestanding/hello_clobbers.c rename to userland/arch/aarch64/c/freestanding/linux/hello_clobbers.c diff --git a/userland/arch/aarch64/c/asm_from_c.c b/userland/arch/aarch64/c/linux/asm_from_c.c similarity index 100% rename from userland/arch/aarch64/c/asm_from_c.c rename to userland/arch/aarch64/c/linux/asm_from_c.c diff --git a/userland/arch/aarch64/c/linux/build b/userland/arch/aarch64/c/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/aarch64/c/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/aarch64/freestanding/linux/build b/userland/arch/aarch64/freestanding/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/aarch64/freestanding/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/aarch64/freestanding/hello.S b/userland/arch/aarch64/freestanding/linux/hello.S similarity index 100% rename from userland/arch/aarch64/freestanding/hello.S rename to userland/arch/aarch64/freestanding/linux/hello.S diff --git a/userland/arch/arm/c/freestanding/linux/build b/userland/arch/arm/c/freestanding/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/arm/c/freestanding/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/arm/c/freestanding/hello.c b/userland/arch/arm/c/freestanding/linux/hello.c similarity index 100% rename from userland/arch/arm/c/freestanding/hello.c rename to userland/arch/arm/c/freestanding/linux/hello.c diff --git a/userland/arch/arm/freestanding/linux/build b/userland/arch/arm/freestanding/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/arm/freestanding/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/arm/freestanding/hello.S b/userland/arch/arm/freestanding/linux/hello.S similarity index 100% rename from userland/arch/arm/freestanding/hello.S rename to userland/arch/arm/freestanding/linux/hello.S diff --git a/userland/arch/arm/linux/build b/userland/arch/arm/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/arm/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/arm/c_from_asm.S b/userland/arch/arm/linux/c_from_asm.S similarity index 100% rename from userland/arch/arm/c_from_asm.S rename to userland/arch/arm/linux/c_from_asm.S diff --git a/userland/arch/x86_64/c/freestanding/linux/build b/userland/arch/x86_64/c/freestanding/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/x86_64/c/freestanding/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/x86_64/c/freestanding/hello.c b/userland/arch/x86_64/c/freestanding/linux/hello.c similarity index 100% rename from userland/arch/x86_64/c/freestanding/hello.c rename to userland/arch/x86_64/c/freestanding/linux/hello.c diff --git a/userland/arch/x86_64/c/freestanding/hello_regvar.c b/userland/arch/x86_64/c/freestanding/linux/hello_regvar.c similarity index 100% rename from userland/arch/x86_64/c/freestanding/hello_regvar.c rename to userland/arch/x86_64/c/freestanding/linux/hello_regvar.c diff --git a/userland/arch/x86_64/freestanding/linux/build b/userland/arch/x86_64/freestanding/linux/build new file mode 120000 index 0000000..ab18017 --- /dev/null +++ b/userland/arch/x86_64/freestanding/linux/build @@ -0,0 +1 @@ +../build \ No newline at end of file diff --git a/userland/arch/x86_64/freestanding/hello.S b/userland/arch/x86_64/freestanding/linux/hello.S similarity index 100% rename from userland/arch/x86_64/freestanding/hello.S rename to userland/arch/x86_64/freestanding/linux/hello.S