chenxiaoyi
7ce5241f0e
types.h: fix windows build error
...
Windows Kits\10\Include\10.0.22621.0\ucrt\corecrt.h(605,39): error C2371: 'wint_t': redefinition; different basic types
Windows Kits\10\Include\10.0.22621.0\ucrt\corecrt.h(606,39): error C2371: 'wctype_t': redefinition; different basic types
Co-authored-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
Co-authored-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-14 22:36:57 +08:00
hujun5
61caf7cce9
types: on some arch, execution speed can be accelerated
...
in arm64 Let's see how the following code looks like in assembly
volatile cpu_set_t g_cpu_set;
cpu_set_t set_cpu_set_t_set(int cpu) {
g_cpu_set &= ~(1 << cpu);
return g_cpu_set;
}
when
typedef volatile uint32_t cpu_set_t;
Dump of assembler code for function set_cpu_set_t_set:
0x0000000040288570 <+0>: adrp x2, 0x403ce000 <g_irqvector+1160>
0x0000000040288574 <+4>: ldr w3, [x2, #2368 ]
0x0000000040288578 <+8>: mov w1, #0x1
0x000000004028857c <+12>: lsl w1, w1, w0
0x0000000040288580 <+16>: bic w1, w3, w1
0x0000000040288584 <+20>: str w1, [x2, #2368 ]
0x0000000040288588 <+24>: ldr w0, [x2, #2368 ]
0x000000004028858c <+28>: ret
when
typedef volatile uint8_t cpu_set_t;
Dump of assembler code for function set_cpu_set_t_set:
0x000000004028856c <+0>: adrp x2, 0x403ce000 <g_irqvector+1192>
0x0000000040288570 <+4>: ldrb w3, [x2, #2336 ]
0x0000000040288574 <+8>: mov w1, #0x1
0x0000000040288578 <+12>: and w3, w3, #0xff // At this time, there will be one more instruction
0x000000004028857c <+16>: lsl w1, w1, w0
0x0000000040288580 <+20>: bic w1, w3, w1
0x0000000040288584 <+24>: strb w1, [x2, #2336 ]
0x0000000040288588 <+28>: ldrb w0, [x2, #2336 ]
0x000000004028858c <+32>: ret
test:
We can use qemu for testing.
compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-05-22 19:10:03 +08:00
YAMAMOTO Takashi
1ec63e1701
make 64-bit time_t back to unsigned
...
it has been changed by https://github.com/apache/nuttx/pull/10303
without any explicit mentions. i suppose it was a mistake.
see https://github.com/apache/nuttx/pull/8201 and referenced PRs
for previous discussions.
2023-12-30 08:48:43 -08:00
chao an
a3d7abb1ae
sys/types: supporting 32-bit IDs for gid_t/uid_t
...
Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-07 18:21:21 +08:00
fangxinyong
891e05d99a
include: move clockid_t and time[r]_t define to sys/types.h
...
POSIX Standard: Primitive System Data Types
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-19 09:08:40 +03:00
Xiang Xiao
5af99c65de
fs: Define __USE_FILE_OFFSET64 when CONFIG_FS_LARGEFILE is enabled
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-30 20:22:10 -03:00
zhanghongyu
7b5af12158
statfs: add f_fsid field for third-party code compile
...
because NuttX doesn't have the device number, so we're not assigning a
valid value here. just memset to zero.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-16 11:10:25 +08:00
Xiang Xiao
92b2f1bd3d
fs: Undefine CONFIG_FS_LARGEFILE if compiler doesn't support long long
...
to simplify the large file check in many place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-02 09:37:58 +01:00
Xiang Xiao
97e994a1f9
Move SEEK_xxx from unistd.h to sys/types.h
...
so fcntl.h, stdio.h and unistd.h could get these definiton:
https://en.cppreference.com/w/c/io/fseek
https://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.html
https://pubs.opengroup.org/onlinepubs/007904975/functions/lseek.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-07 12:16:22 +02:00
Xiang Xiao
78f6a02bc8
boards: Remove the duplicated prototype of CONFIG_INIT_ENTRYPOINT
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:02:44 +02:00
Jiuzhu Dong
008cb0d31a
sys/sysmacros.h: support sysmacros header
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 11:10:08 +08:00
chao.an
644283c8ff
libc/ipc: add ftok(3) support
...
https://man.openbsd.org/ftok.3
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-09 18:19:48 +03:00
Xiang Xiao
0f2f48f8ba
sys/type.h: Change pid_t from int16_t to int
...
to fix the following warning:
include/unistd.h:302:9: error: incompatible redeclaration of library function 'vfork' [-Werror,-Wincompatible-library-redeclaration]
pid_t vfork(void);
^
include/unistd.h:302:9: note: 'vfork' is a builtin with type 'int (void)'
and change 32768 to INT_MAX to match the type change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-21 15:48:33 +02:00
Xiang Xiao
77792a1598
sched: Define CONFIG_SMP_NCPUS to 1 in no SMP case
...
to simplify the SMP related code logic
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 23:21:21 +08:00
Xiang Xiao
6357523892
arch: Add _wchar_t typedef like other basic types
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-09 16:57:23 +09:00
Gustavo Henrique Nihei
5dfb2713f6
include: Add __socklen_t_defined for compatibility to other C libraries
...
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-09 08:19:27 -06:00
Xiang Xiao
319474b1b1
fs: Change off_t and related types to int64_t if long long is supported
...
since it is very popular that the storage capcacity is large than 4GB
even in the embedded system:
https://www.opengroup.org/platform/lfs.html
https://en.wikipedia.org/wiki/Large-file_support
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I019dc08aff02f9ea01eb6d750033bbc358994da5
2021-08-04 06:48:30 -07:00
Alin Jerpelea
9b9be7e1f0
include: Author: Gregory Nutt: update licenses to Apache 2.0
...
Update files from Gregory Nutt to Apache 2.0 license.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-04 03:33:58 -08:00
Xiang Xiao
bb8c4485a2
libc: Change OK/ERROR macro to enum
...
to avoid the conflict with 3rd party c++ library(e.g. protobuf):
fdc35840b9/src/google/protobuf/stubs/status.h (L47)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie8bb9008a8375c729f8b947c9f10baa80104d157
2020-11-30 09:43:18 +01:00
YAMAMOTO Takashi
e99e185712
Don't typedef wchar_t for C++
...
wchar_t is a builtin type in C++.
clang complains like the following even with -fshort-wchar:
error: cannot combine with previous 'type-name' declaration specifier
my clang version if it matters:
spacetanuki% clang++ --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
spacetanuki% clang++ -dM -E - < /dev/null | grep WCHAR
#define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __SIZEOF_WCHAR_T__ 4
#define __WCHAR_MAX__ 2147483647
#define __WCHAR_TYPE__ int
#define __WCHAR_WIDTH__ 32
spacetanuki% clang++ -fshort-wchar -dM -E - < /dev/null | grep WCHAR
#define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __SIZEOF_WCHAR_T__ 2
#define __WCHAR_MAX__ 65535
#define __WCHAR_TYPE__ unsigned short
#define __WCHAR_UNSIGNED__ 1
#define __WCHAR_WIDTH__ 16
spacetanuki%
2020-11-01 18:19:13 -08:00
ligd
c8c2745fa7
include/sys/types.h: add u_intXX_t support
...
like u_int8_t u_int16_t u_in32_t...
Change-Id: Ieee5014bddb1cf1a6e769af7258ff524263f67fb
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-09-11 10:41:24 +08:00
Xiang Xiao
6f6d61eec4
fs/vfs: Implement statvfs and fstatvfs
...
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/statvfs.h.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-13 20:25:03 +01:00
Xiang Xiao
d17b963bca
libc: Move double_t typedef from sys/types.h to math.h
...
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 13:37:41 +01:00
Xiang Xiao
e7d9260014
arch: Customize the typedef of size_t instead of intptr_t
...
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG. The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
2020-02-18 07:15:19 -06:00
Xiang Xiao
b58ccc96e4
include/sys/stat.h and include/sys/types.h: Update struct stat to confirm opengroup spec:
...
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html
2019-11-19 09:54:57 -06:00
Gregory Nutt
bf3105fc8f
include/sys/types.h: Remove non-standard HP-UX priority range definitionis. HP-UX is not a supported OS.
2019-09-10 14:02:40 -06:00
Gregory Nutt
58743b7488
The non-standard, non-portable type cpu_set_t was created specifically to support the NuttX internal, SMP implementation. Any resemblance to any other cpu_set_t would be purely coincidental. However it appears that that coincidence has occurred. cpu_set_t is an equivalent, non-standard, non-portable type in the GNU C library. Compilation of libgnat expects this non-standard type to be defined. Who am I to standard in the way of progress? This commit removes the conditioning on CONFIG_SMP so that cpu_set_t is typed (as a uint8_t) even if CONFIG_SMP is not defined. Reference: Bitbucket issue 164.
2019-08-29 10:03:01 -06:00
Xiang Xiao
894ca622e6
nclude/sys/types: Move wint_t and wctype_t from wchar.h to types.h. This change is compatible as before since wchar.h include types.h indirectly. This fixes a compilation error with newlib's math.h: 'unknown type name wint_t'
2018-08-27 06:26:37 -06:00
Gregory Nutt
5db2f993f9
Trivial updates from review of vecto I/O logic.
2018-06-23 09:01:42 -06:00
Gregory Nutt
8fdbb1e0a4
Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
...
Squashed commit of the following:
sched: Rename all use of system_t to clock_t.
syscall: Rename all use of system_t to clock_t.
net: Rename all use of system_t to clock_t.
libs: Rename all use of system_t to clock_t.
fs: Rename all use of system_t to clock_t.
drivers: Rename all use of system_t to clock_t.
arch: Rename all use of system_t to clock_t.
include: Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Gregory Nutt
22484386ee
fs/cromfs and tools/gencromfs: Various fixes for traversal relative file paths. Biggest changes is in types used: Cannot use size_t or mode_t in common structures because they have different sizes on the (64-bit) host and the (32-bit) target. Use uint32_t instead of size_t for offsets. Use uint16_t instead of mode_t.
2018-03-20 12:37:01 -06:00
Gregory Nutt
1a990f99d1
libc/time: Add an implementationof clock()
2018-03-13 08:07:29 -06:00
Gregory Nutt
9eca03b9be
tools/configure.sh: Another fix for the script. The last change only worked for Windows Cygwin; for Linux, it needed to remove some additional things from the defconfig file.
2017-10-01 14:24:57 -06:00
Gregory Nutt
54fd0f0a04
Fix a few more compile issues with the new wide character support
2016-10-19 08:18:46 -06:00
Gregory Nutt
2075eb7932
Fix a typo introduced in the last commit and a file that was missed in the last commit
2016-02-19 16:03:01 -06:00
Gregory Nutt
3147dfc7d5
SMP: Add some tentative initialization logic
2016-02-10 13:49:27 -06:00
Gregory Nutt
6230e6e199
size_t should be 64-bits on a 64-bit machine. mmsize_t should be 32-bits (unless CONFIG_MM_SMALL is selected). This commit backs out the last change to stddef.h
2015-11-23 12:03:36 -06:00
Gregory Nutt
cb9e27c3b0
Standardize naming used for public data and function groupings
2015-10-02 16:30:35 -06:00
Gregory Nutt
bcae42b653
Costmetic updates comments and style; Add NFS dependency on IPv4
2015-02-26 06:04:23 -06:00
Gregory Nutt
5afa3ec59d
Add BSD and SYSV types to sys/types to simplify porting. From Max Neklyudov
2015-02-25 14:01:14 -06:00
Gregory Nutt
d6704a1cd7
Suffer the consequences of moving struct timeval to its correct location
2015-02-15 15:18:35 -06:00
Gregory Nutt
b660a708d4
Add shared memory definitions, types, prototypes
2014-09-22 09:29:37 -06:00
Gregory Nutt
752068073a
Forgot to add stpcpy.c in last commit
2014-01-10 07:09:59 -06:00
Gregory Nutt
8e1b493786
Fix some of the SIZE_MAX definitions updated in a recent commit
2014-01-08 08:25:46 -06:00
Gregory Nutt
c5f9b8768e
Add type rsize_t and function gets_s()
2014-01-07 16:27:45 -06:00
Gregory Nutt
1da566f27b
Make sure that the Z16F build still builds and runs
2014-01-01 10:29:44 -06:00
patacongo
3736ae6ba9
Add logic to retain child task exit status if so configured
...
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5553 42af7a65-404d-4744-a932-0658087f49c3
2013-01-23 22:23:46 +00:00
patacongo
b8e53dad52
Use SIGCHLD with waitpid(); implemented wait() and waitid()
...
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5515 42af7a65-404d-4744-a932-0658087f49c3
2013-01-13 18:53:00 +00:00
patacongo
7e20685e1a
Define NULL to be (0) for C++
...
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5023 42af7a65-404d-4744-a932-0658087f49c3
2012-08-12 17:49:35 +00:00
patacongo
8e5733ae3f
Header file clean-up
...
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4948 42af7a65-404d-4744-a932-0658087f49c3
2012-07-17 03:58:11 +00:00