From 0c9afcf9b6740a0f8d0939622fba996a84420957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 5 May 2019 00:00:00 +0000 Subject: [PATCH] asm: prefix every linux specific with linux/ --- README.adoc | 27 ++++++++++--------- .../arch/aarch64/c/freestanding/linux/build | 1 + .../c/freestanding/{ => linux}/hello.c | 0 .../freestanding/{ => linux}/hello_clobbers.c | 0 .../arch/aarch64/c/{ => linux}/asm_from_c.c | 0 userland/arch/aarch64/c/linux/build | 1 + .../arch/aarch64/freestanding/linux/build | 1 + .../aarch64/freestanding/{ => linux}/hello.S | 0 userland/arch/arm/c/freestanding/linux/build | 1 + .../arm/c/freestanding/{ => linux}/hello.c | 0 userland/arch/arm/freestanding/linux/build | 1 + .../arch/arm/freestanding/{ => linux}/hello.S | 0 userland/arch/arm/linux/build | 1 + userland/arch/arm/{ => linux}/c_from_asm.S | 0 .../arch/x86_64/c/freestanding/linux/build | 1 + .../x86_64/c/freestanding/{ => linux}/hello.c | 0 .../c/freestanding/{ => linux}/hello_regvar.c | 0 userland/arch/x86_64/freestanding/linux/build | 1 + .../x86_64/freestanding/{ => linux}/hello.S | 0 19 files changed, 23 insertions(+), 12 deletions(-) create mode 120000 userland/arch/aarch64/c/freestanding/linux/build rename userland/arch/aarch64/c/freestanding/{ => linux}/hello.c (100%) rename userland/arch/aarch64/c/freestanding/{ => linux}/hello_clobbers.c (100%) rename userland/arch/aarch64/c/{ => linux}/asm_from_c.c (100%) create mode 120000 userland/arch/aarch64/c/linux/build create mode 120000 userland/arch/aarch64/freestanding/linux/build rename userland/arch/aarch64/freestanding/{ => linux}/hello.S (100%) create mode 120000 userland/arch/arm/c/freestanding/linux/build rename userland/arch/arm/c/freestanding/{ => linux}/hello.c (100%) create mode 120000 userland/arch/arm/freestanding/linux/build rename userland/arch/arm/freestanding/{ => linux}/hello.S (100%) create mode 120000 userland/arch/arm/linux/build rename userland/arch/arm/{ => linux}/c_from_asm.S (100%) create mode 120000 userland/arch/x86_64/c/freestanding/linux/build rename userland/arch/x86_64/c/freestanding/{ => linux}/hello.c (100%) rename userland/arch/x86_64/c/freestanding/{ => linux}/hello_regvar.c (100%) create mode 120000 userland/arch/x86_64/freestanding/linux/build rename userland/arch/x86_64/freestanding/{ => linux}/hello.S (100%) 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