[PATCH v3 1/3] linux-headers: Add unistd_64.h

Bibo Mao posted 3 patches 3 weeks, 5 days ago
[PATCH v3 1/3] linux-headers: Add unistd_64.h
Posted by Bibo Mao 3 weeks, 5 days ago
since 6.11, unistd.h includes header file unistd_64.h directly on
some platforms, here add unistd_64.h on these platforms. Affected
platforms are ARM64, LoongArch64 and Riscv. Otherwise there will
be compiling error such as:

linux-headers/asm/unistd.h:3:10: fatal error: asm/unistd_64.h: No such file or directory
 #include <asm/unistd_64.h>

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 scripts/update-linux-headers.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index c34ac6454e..203f48d089 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -163,6 +163,7 @@ EOF
     fi
     if [ $arch = arm64 ]; then
         cp "$hdrdir/include/asm/sve_context.h" "$output/linux-headers/asm-arm64/"
+        cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-arm64/"
     fi
     if [ $arch = x86 ]; then
         cp "$hdrdir/include/asm/unistd_32.h" "$output/linux-headers/asm-x86/"
@@ -185,6 +186,11 @@ EOF
     fi
     if [ $arch = riscv ]; then
         cp "$hdrdir/include/asm/ptrace.h" "$output/linux-headers/asm-riscv/"
+        cp "$hdrdir/include/asm/unistd_32.h" "$output/linux-headers/asm-riscv/"
+        cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-riscv/"
+    fi
+    if [ $arch = loongarch ]; then
+        cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-loongarch/"
     fi
 done
 arch=
-- 
2.39.3
Re: [PATCH v3 1/3] linux-headers: Add unistd_64.h
Posted by gaosong 3 weeks, 5 days ago
在 2024/10/28 上午10:38, Bibo Mao 写道:
> since 6.11, unistd.h includes header file unistd_64.h directly on
> some platforms, here add unistd_64.h on these platforms. Affected
> platforms are ARM64, LoongArch64 and Riscv. Otherwise there will
> be compiling error such as:
>
> linux-headers/asm/unistd.h:3:10: fatal error: asm/unistd_64.h: No such file or directory
>   #include <asm/unistd_64.h>
Hi,  Bibo

Could you help tested this patch on ARM machine? I don't have an ARM 
machine.

Thanks.
Song Gao
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   scripts/update-linux-headers.sh | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index c34ac6454e..203f48d089 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -163,6 +163,7 @@ EOF
>       fi
>       if [ $arch = arm64 ]; then
>           cp "$hdrdir/include/asm/sve_context.h" "$output/linux-headers/asm-arm64/"
> +        cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-arm64/"
>       fi
>       if [ $arch = x86 ]; then
>           cp "$hdrdir/include/asm/unistd_32.h" "$output/linux-headers/asm-x86/"
> @@ -185,6 +186,11 @@ EOF
>       fi
>       if [ $arch = riscv ]; then
>           cp "$hdrdir/include/asm/ptrace.h" "$output/linux-headers/asm-riscv/"
> +        cp "$hdrdir/include/asm/unistd_32.h" "$output/linux-headers/asm-riscv/"
> +        cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-riscv/"
> +    fi
> +    if [ $arch = loongarch ]; then
> +        cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-loongarch/"
>       fi
>   done
>   arch=


Re: [PATCH v3 1/3] linux-headers: Add unistd_64.h
Posted by maobibo 3 weeks, 5 days ago

On 2024/10/28 下午3:39, gaosong wrote:
> 在 2024/10/28 上午10:38, Bibo Mao 写道:
>> since 6.11, unistd.h includes header file unistd_64.h directly on
>> some platforms, here add unistd_64.h on these platforms. Affected
>> platforms are ARM64, LoongArch64 and Riscv. Otherwise there will
>> be compiling error such as:
>>
>> linux-headers/asm/unistd.h:3:10: fatal error: asm/unistd_64.h: No such 
>> file or directory
>>   #include <asm/unistd_64.h>
> Hi,  Bibo
> 
> Could you help tested this patch on ARM machine? I don't have an ARM 
> machine.
yeap, I test on arm64 machine, it passes to compile with header files 
updated. However there is no riscv machine by hand.

Regards
Bibo Mao
> 
> Thanks.
> Song Gao
>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>> ---
>>   scripts/update-linux-headers.sh | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/scripts/update-linux-headers.sh 
>> b/scripts/update-linux-headers.sh
>> index c34ac6454e..203f48d089 100755
>> --- a/scripts/update-linux-headers.sh
>> +++ b/scripts/update-linux-headers.sh
>> @@ -163,6 +163,7 @@ EOF
>>       fi
>>       if [ $arch = arm64 ]; then
>>           cp "$hdrdir/include/asm/sve_context.h" 
>> "$output/linux-headers/asm-arm64/"
>> +        cp "$hdrdir/include/asm/unistd_64.h" 
>> "$output/linux-headers/asm-arm64/"
>>       fi
>>       if [ $arch = x86 ]; then
>>           cp "$hdrdir/include/asm/unistd_32.h" 
>> "$output/linux-headers/asm-x86/"
>> @@ -185,6 +186,11 @@ EOF
>>       fi
>>       if [ $arch = riscv ]; then
>>           cp "$hdrdir/include/asm/ptrace.h" 
>> "$output/linux-headers/asm-riscv/"
>> +        cp "$hdrdir/include/asm/unistd_32.h" 
>> "$output/linux-headers/asm-riscv/"
>> +        cp "$hdrdir/include/asm/unistd_64.h" 
>> "$output/linux-headers/asm-riscv/"
>> +    fi
>> +    if [ $arch = loongarch ]; then
>> +        cp "$hdrdir/include/asm/unistd_64.h" 
>> "$output/linux-headers/asm-loongarch/"
>>       fi
>>   done
>>   arch=
> 


Re: [PATCH v3 1/3] linux-headers: Add unistd_64.h
Posted by gaosong 3 weeks, 3 days ago
在 2024/10/28 下午5:55, maobibo 写道:
>
>
> On 2024/10/28 下午3:39, gaosong wrote:
>> 在 2024/10/28 上午10:38, Bibo Mao 写道:
>>> since 6.11, unistd.h includes header file unistd_64.h directly on
>>> some platforms, here add unistd_64.h on these platforms. Affected
>>> platforms are ARM64, LoongArch64 and Riscv. Otherwise there will
>>> be compiling error such as:
>>>
>>> linux-headers/asm/unistd.h:3:10: fatal error: asm/unistd_64.h: No 
>>> such file or directory
>>>   #include <asm/unistd_64.h>
>> Hi,  Bibo
>>
>> Could you help tested this patch on ARM machine? I don't have an ARM 
>> machine.
> yeap, I test on arm64 machine, it passes to compile with header files 
> updated. However there is no riscv machine by hand.
>
Thank you,

@Peter and  @Alistair Francis Could you help tested this patch on RISCV 
machine?

Thanks.
Song Gao

> Regards
> Bibo Mao
>>
>> Thanks.
>> Song Gao
>>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>>> ---
>>>   scripts/update-linux-headers.sh | 6 ++++++
>>>   1 file changed, 6 insertions(+)
>>>
>>> diff --git a/scripts/update-linux-headers.sh 
>>> b/scripts/update-linux-headers.sh
>>> index c34ac6454e..203f48d089 100755
>>> --- a/scripts/update-linux-headers.sh
>>> +++ b/scripts/update-linux-headers.sh
>>> @@ -163,6 +163,7 @@ EOF
>>>       fi
>>>       if [ $arch = arm64 ]; then
>>>           cp "$hdrdir/include/asm/sve_context.h" 
>>> "$output/linux-headers/asm-arm64/"
>>> +        cp "$hdrdir/include/asm/unistd_64.h" 
>>> "$output/linux-headers/asm-arm64/"
>>>       fi
>>>       if [ $arch = x86 ]; then
>>>           cp "$hdrdir/include/asm/unistd_32.h" 
>>> "$output/linux-headers/asm-x86/"
>>> @@ -185,6 +186,11 @@ EOF
>>>       fi
>>>       if [ $arch = riscv ]; then
>>>           cp "$hdrdir/include/asm/ptrace.h" 
>>> "$output/linux-headers/asm-riscv/"
>>> +        cp "$hdrdir/include/asm/unistd_32.h" 
>>> "$output/linux-headers/asm-riscv/"
>>> +        cp "$hdrdir/include/asm/unistd_64.h" 
>>> "$output/linux-headers/asm-riscv/"
>>> +    fi
>>> +    if [ $arch = loongarch ]; then
>>> +        cp "$hdrdir/include/asm/unistd_64.h" 
>>> "$output/linux-headers/asm-loongarch/"
>>>       fi
>>>   done
>>>   arch=
>>


Re: [PATCH v3 1/3] linux-headers: Add unistd_64.h
Posted by Alistair Francis 3 weeks, 3 days ago
On Wed, Oct 30, 2024 at 11:47 AM gaosong <gaosong@loongson.cn> wrote:
>
> 在 2024/10/28 下午5:55, maobibo 写道:
> >
> >
> > On 2024/10/28 下午3:39, gaosong wrote:
> >> 在 2024/10/28 上午10:38, Bibo Mao 写道:
> >>> since 6.11, unistd.h includes header file unistd_64.h directly on
> >>> some platforms, here add unistd_64.h on these platforms. Affected
> >>> platforms are ARM64, LoongArch64 and Riscv. Otherwise there will
> >>> be compiling error such as:
> >>>
> >>> linux-headers/asm/unistd.h:3:10: fatal error: asm/unistd_64.h: No
> >>> such file or directory
> >>>   #include <asm/unistd_64.h>
> >> Hi,  Bibo
> >>
> >> Could you help tested this patch on ARM machine? I don't have an ARM
> >> machine.
> > yeap, I test on arm64 machine, it passes to compile with header files
> > updated. However there is no riscv machine by hand.
> >
> Thank you,
>
> @Peter and  @Alistair Francis Could you help tested this patch on RISCV
> machine?

I don't have a RISC-V machine either unfortunately.

You can test it with QEMU though

Alistair
Re: [PATCH v3 1/3] linux-headers: Add unistd_64.h
Posted by maobibo 3 weeks, 1 day ago
It passed to compile on riscv machine, and the testbed is riscv qemu VM.

Regards
Bibo Mao

On 2024/10/30 下午12:06, Alistair Francis wrote:
> On Wed, Oct 30, 2024 at 11:47 AM gaosong <gaosong@loongson.cn> wrote:
>>
>> 在 2024/10/28 下午5:55, maobibo 写道:
>>>
>>>
>>> On 2024/10/28 下午3:39, gaosong wrote:
>>>> 在 2024/10/28 上午10:38, Bibo Mao 写道:
>>>>> since 6.11, unistd.h includes header file unistd_64.h directly on
>>>>> some platforms, here add unistd_64.h on these platforms. Affected
>>>>> platforms are ARM64, LoongArch64 and Riscv. Otherwise there will
>>>>> be compiling error such as:
>>>>>
>>>>> linux-headers/asm/unistd.h:3:10: fatal error: asm/unistd_64.h: No
>>>>> such file or directory
>>>>>    #include <asm/unistd_64.h>
>>>> Hi,  Bibo
>>>>
>>>> Could you help tested this patch on ARM machine? I don't have an ARM
>>>> machine.
>>> yeap, I test on arm64 machine, it passes to compile with header files
>>> updated. However there is no riscv machine by hand.
>>>
>> Thank you,
>>
>> @Peter and  @Alistair Francis Could you help tested this patch on RISCV
>> machine?
> 
> I don't have a RISC-V machine either unfortunately.
> 
> You can test it with QEMU though
> 
> Alistair
>