[PATCH v10 17/26] linux-user: Add LoongArch generic header files

Song Gao posted 26 patches 3 years, 11 months ago
Maintainers: Laurent Vivier <laurent@vivier.eu>, Song Gao <gaosong@loongson.cn>
There is a newer version of this series
[PATCH v10 17/26] linux-user: Add LoongArch generic header files
Posted by Song Gao 3 years, 11 months ago
This includes:
- sockbits.h
- target_errno_defs.h
- target_fcntl.h
- termbits.h

Signed-off-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
---
 linux-user/loongarch64/sockbits.h          | 1 +
 linux-user/loongarch64/target_errno_defs.h | 7 +++++++
 linux-user/loongarch64/target_fcntl.h      | 6 ++++++
 linux-user/loongarch64/termbits.h          | 1 +
 4 files changed, 15 insertions(+)
 create mode 100644 linux-user/loongarch64/sockbits.h
 create mode 100644 linux-user/loongarch64/target_errno_defs.h
 create mode 100644 linux-user/loongarch64/target_fcntl.h
 create mode 100644 linux-user/loongarch64/termbits.h

diff --git a/linux-user/loongarch64/sockbits.h b/linux-user/loongarch64/sockbits.h
new file mode 100644
index 0000000..0e4c8f0
--- /dev/null
+++ b/linux-user/loongarch64/sockbits.h
@@ -0,0 +1 @@
+#include "../generic/sockbits.h"
diff --git a/linux-user/loongarch64/target_errno_defs.h b/linux-user/loongarch64/target_errno_defs.h
new file mode 100644
index 0000000..17165c1
--- /dev/null
+++ b/linux-user/loongarch64/target_errno_defs.h
@@ -0,0 +1,7 @@
+#ifndef LOONGARCH_TARGET_ERRNO_DEFS_H
+#define LOONGARCH_TARGET_ERRNO_DEFS_H
+
+/* Target uses generic errno */
+#include "../generic/target_errno_defs.h"
+
+#endif
diff --git a/linux-user/loongarch64/target_fcntl.h b/linux-user/loongarch64/target_fcntl.h
new file mode 100644
index 0000000..9fa3c99
--- /dev/null
+++ b/linux-user/loongarch64/target_fcntl.h
@@ -0,0 +1,6 @@
+#ifndef LOONGARCH_TARGET_FCNTL_H
+#define LOONGARCH_TARGET_FCNTL_H
+
+#include "../generic/fcntl.h"
+
+#endif  /* LOONGARCH_TARGET_FCNTL_H */
diff --git a/linux-user/loongarch64/termbits.h b/linux-user/loongarch64/termbits.h
new file mode 100644
index 0000000..b1d4f4f
--- /dev/null
+++ b/linux-user/loongarch64/termbits.h
@@ -0,0 +1 @@
+#include "../generic/termbits.h"
-- 
1.8.3.1


Re: [PATCH v10 17/26] linux-user: Add LoongArch generic header files
Posted by Philippe Mathieu-Daudé 3 years, 10 months ago
Hi,

On 11/12/21 07:54, Song Gao wrote:
> This includes:
> - sockbits.h
> - target_errno_defs.h
> - target_fcntl.h
> - termbits.h
> 
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
> ---
>  linux-user/loongarch64/sockbits.h          | 1 +
>  linux-user/loongarch64/target_errno_defs.h | 7 +++++++
>  linux-user/loongarch64/target_fcntl.h      | 6 ++++++
>  linux-user/loongarch64/termbits.h          | 1 +
>  4 files changed, 15 insertions(+)
>  create mode 100644 linux-user/loongarch64/sockbits.h
>  create mode 100644 linux-user/loongarch64/target_errno_defs.h
>  create mode 100644 linux-user/loongarch64/target_fcntl.h
>  create mode 100644 linux-user/loongarch64/termbits.h
> 
> diff --git a/linux-user/loongarch64/sockbits.h b/linux-user/loongarch64/sockbits.h
> new file mode 100644
> index 0000000..0e4c8f0
> --- /dev/null
> +++ b/linux-user/loongarch64/sockbits.h
> @@ -0,0 +1 @@

Why not guarding the header here, ...

> +#include "../generic/sockbits.h"
> diff --git a/linux-user/loongarch64/target_errno_defs.h b/linux-user/loongarch64/target_errno_defs.h
> new file mode 100644
> index 0000000..17165c1
> --- /dev/null
> +++ b/linux-user/loongarch64/target_errno_defs.h
> @@ -0,0 +1,7 @@
> +#ifndef LOONGARCH_TARGET_ERRNO_DEFS_H
> +#define LOONGARCH_TARGET_ERRNO_DEFS_H

... but guard this one?

> +
> +/* Target uses generic errno */
> +#include "../generic/target_errno_defs.h"
> +
> +#endif

New files require a license. I'd recommend adding a SPDX
tag in the first line. For example with GPLv2+:

/* SPDX-License-Identifier: GPL-2.0-or-later */

Re: [PATCH v10 17/26] linux-user: Add LoongArch generic header files
Posted by gaosong 3 years, 10 months ago
Hi Philippe,

On 2021/11/16 下午4:33, Philippe Mathieu-Daudé wrote:
> Hi,
>
> On 11/12/21 07:54, Song Gao wrote:
>> This includes:
>> - sockbits.h
>> - target_errno_defs.h
>> - target_fcntl.h
>> - termbits.h
>>
>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
>> ---
>>   linux-user/loongarch64/sockbits.h          | 1 +
>>   linux-user/loongarch64/target_errno_defs.h | 7 +++++++
>>   linux-user/loongarch64/target_fcntl.h      | 6 ++++++
>>   linux-user/loongarch64/termbits.h          | 1 +
>>   4 files changed, 15 insertions(+)
>>   create mode 100644 linux-user/loongarch64/sockbits.h
>>   create mode 100644 linux-user/loongarch64/target_errno_defs.h
>>   create mode 100644 linux-user/loongarch64/target_fcntl.h
>>   create mode 100644 linux-user/loongarch64/termbits.h
>>
>> diff --git a/linux-user/loongarch64/sockbits.h b/linux-user/loongarch64/sockbits.h
>> new file mode 100644
>> index 0000000..0e4c8f0
>> --- /dev/null
>> +++ b/linux-user/loongarch64/sockbits.h
>> @@ -0,0 +1 @@
> Why not guarding the header here, ...
>
>> +#include "../generic/sockbits.h"
>> diff --git a/linux-user/loongarch64/target_errno_defs.h b/linux-user/loongarch64/target_errno_defs.h
>> new file mode 100644
>> index 0000000..17165c1
>> --- /dev/null
>> +++ b/linux-user/loongarch64/target_errno_defs.h
>> @@ -0,0 +1,7 @@
>> +#ifndef LOONGARCH_TARGET_ERRNO_DEFS_H
>> +#define LOONGARCH_TARGET_ERRNO_DEFS_H
> ... but guard this one?
>> +
>> +/* Target uses generic errno */
>> +#include "../generic/target_errno_defs.h"
>> +
>> +#endif
> New files require a license. I'd recommend adding a SPDX
> tag in the first line. For example with GPLv2+:
>
> /* SPDX-License-Identifier: GPL-2.0-or-later */

Yes, except for sockbits.h and target_errno_defs.h, other files are in this format.
Sould we need to unify al files formats like this?  I see that the most of linux-user/ARCH/ sockets.h and target_errno_defs,h are the same.

Thanks
Song Gao