Commit Graph

199 Commits

Author SHA1 Message Date
Gregory Nutt
f751aff7fe boards/boardctl.c and libs/libc/builtin: The BINFS file system uses the same builtin library and builtin arrays as does NSH. The builtin arrays are simple name-value pairs that map builtin function names with the user-space entry point. In the FLAT build, the builtin arrays are available everywhere via the backdoor left open by the FLAT address space. In the PROTECTED build, however, the kernel must maintain its own reference to the user-space builtin array. This commits adds those kernel globals and a new boardctl(BOARDIOC_BUILTINS) that can be used by applications to the provide the builtin list reference to the kernel. 2019-08-25 16:58:43 -06:00
Gregory Nutt
3c30cf1f05 Squashed commit of the following:
task_spawn() and posix_spawn() are NuttX OS interfaces.  In PROTECTED and KERNEL build modes, then can be reached from applications only via a system call.  Currently, the number of parameters in a system call is limited to six; these spawn function have seven parameters.  Rather than extend the maximum number of parameters across all architectures, I opted instead to marshal the seven parameters into a structure.
     *

In order to support builtin in function in protected mode, a task_spawn() system call must be supported.  Unfortunately this is overly complex because there is a (soft) limit of 6 parameters in a system call; task_spawn has seven paramters.  This is a soft limit but still difficult to extend because it involves assembly language changes to numerous architectures.  Better to get more creative.
2019-08-23 13:20:52 -06:00
Gregory Nutt
a2d8e108a6 libs/libc/Kconfig: Correct a typo in Kconfig file. 2019-08-23 11:07:09 -06:00
Gregory Nutt
dd97fb991b This commit moves shared builtin information out of binfmt/libbuiltin and into libs/libc/builtin where it can be shared. This should permit builtin application in the PROTECTED build where binfmt/libbuiltin is not available in user space.
Squashed commit of the following:

    Correct some additional compile-related issues.

    Move  include/nuttx/binfmt/builtin.h to include/nuttx/lib/builtin.h.  Move apps/builtin/lib_builtin_forindex.c to libs/libc/builtin/lib_builtin_forindex.c.

    Move binfmt/libbuiltin to libs/libc/builtin.  There are calls made directly from apps/nshlib into this logic and hence, must be part of a library that can be shared between the OS and applications.
2019-08-23 09:07:40 -06:00
Pavel Pisa
c7a4720a51 libs/libc/libc.csv: Add some missing C library functions. 2019-08-15 14:35:00 -06:00
Pavel Pisa
380198c985 symtab/, tools/: NuttX provides lists of available syscalls and library functions and tools to process them. The lists can be used to build symbol table which allows runtime program loading which can reuse functions already compiled into NuttX system image. List processing, compilation and linking to the final system image has been possible only under manual control until now.
Provided changes add option (CONFIG_EXECFUNCS_GENERATE_SYSTEM_SYMTAB) to build complete list of available functions and syscalls automatically.  The symbolic table is generated in form libsymtab.a which can be reused by application or directly pull in when "g_symtab" and "g_nsymbols" variables are requested by EXECFUNCS configuration.

I have tried to follow mechanisms for library compilation in different kernel protection modes but tested only flat no-MMU build. The basic assumption is that this library and libraries providing syscall stubs and C-library functions are available in user-space context and initial application (usually NSH) registers the symbol table through IOCTL.  The table can be reused then by another applications in their address space as kernel allows. Simple for flat or protected mode, I am not sure if really support in MMU mode. It is highly probable that I have made some mistake, overlooked something, but functionality is optional (should not cause troubles in any mode if disabled) and main purpose is to lower memory overhead when more applications are loaded on memory constrained system which usually use direct kernel calling without protection or address space separation. If the table should be provided by kernel to applications then makefiles has to be adjusted.
2019-08-13 09:09:43 -06:00
Pavel Pisa
e3c2a0238a libs/libc/libc.csv: Correct dependency of setlocale on CONFIG_LIBC_LOCALE. 2019-08-13 08:58:04 -06:00
Pavel Pisa
2d9fb956aa libs/libc/math.csv: Correct format of some function entries. 2019-08-13 08:56:38 -06:00
Gregory Nutt
eb5a8c7cea libs/libc/grp and pwd: Revisit file looks. Use uintptr_t vs void* to incode mixed pointers and integer values. 2019-08-11 11:26:09 -06:00
Gregory Nutt
e6da85deb3 sched/group/group_setuid.c and group_setguid.c: Verify that the UID/GID is within range. 2019-08-10 10:42:53 -06:00
Gregory Nutt
240926c995 Beginning to update comments to reflect new organization of the boards/ sub-directory. 2019-08-08 08:46:54 -06:00
Gregory Nutt
ec5120f69e sched/group and syscall/: Implement 'real' setuid, getuid, setgid, and getgid interfaces. These will be inheritance by all child task groups. 2019-08-06 14:13:43 -06:00
Gregory Nutt
945e27d85c libs/libc/unistd.h: Add getuid() and getgid() to match Michael Jung's setuid() and setgid(). 2019-08-06 12:38:43 -06:00
Michael Jung
e8af615578 libs/libc/unistd: Stubs for setuid and setgid. Added stubbed implementations of setuid and setgid. These functions are essentially stubs pretending that NuttX supported users and groups and that the only configured user and group in the system were both 'root' with a uid and a gid of 0, respectively. The intent is not to provide meaningful new features, but to ease porting of foreign source code to NuttX. 2019-08-06 07:17:23 -06:00
Gregory Nutt
721994846c tools/: Change preferred argument of configurations tools to use ':' as the delimiter between <board-name> and <config-name>. This is to emphasize that this is not a path; it is configuration specification.
The legacy '/' delimiter is still supported but not recommend and not advertised.

Squashed commit of the following:

    Update configurations instructions in more README.txt files to show ':' delimiter vs '/' delimiter.
    Update configurations instructions in various README.txt file to show ':' delimiter vs '/' delimiter.
    tools:  Update all configuration-related tools to accept ':' separator between board and configuration name.
2019-08-05 16:55:51 -06:00
Gregory Nutt
615c0ea7ee Change naming configs/ to boards in comments, Documentation, etc. Still a few more to go. 2019-08-05 07:13:48 -06:00
Gregory Nutt
89da9f2fea libs/libc/pwd and libs/libc/grp: Modify to giet user/group data from /etc/passwd and /etc/group if so configurated.
Squashed commit of the following:

    Last minute clean-up
    libs/libc/grp/lib_find_grpfile.c:  Fix some problems found in testing.
    libs/libc/pwd:  Finishes off implementation using /etc/passwd.
    libs/libc/grp:  Finishes off implementation using /etc/group.
    libs/libc/pwd/lib_find_pwdfile.c:  Add logic to look up user information in /etc/passwd file, if available.
    libs/libc/grp/lib_find_grpfile.c:  Add logic to look up group information in /etc/group file, if available.
2019-08-04 13:32:36 -06:00
Michael Jung
f3c85bd253 libc/pwd: Added stubbed implementations
Added stubbed implementations of getpwuid, getpwuid_r, getpwnam, and
getpwnam_r.  These functions are essentially stubs pretending that NuttX
supported users and that the only configured user in the system was 'root'
with uid 0.  The intend is not to provide meaningful new features, but to ease
porting of foreign source code to NuttX.
2019-08-04 07:18:58 -06:00
Gregory Nutt
2fcff93d20 libs/libc/grp/lib_grp.c: Fix a warning when compiling on a 64-bit simulation. Cannot cast a pointer to unsigned in that case because unsigned (int) is only 32-bits, but the pointer is 64-bits. 2019-08-03 08:41:55 -06:00
Michael Jung
1af4c94391 libc/grp: Added stubbed implementations of getgrgid, getgrgid_r, getgrnam, getgrnam_r, and initgroups. These functions are essentially stubs pretending that NuttX supported groups and that the only configured group in the system was 'root' with gid 0. The intend is not to provide meaningful new features, but to ease porting of foreign source code to NuttX. 2019-08-03 08:23:04 -06:00
Gregory Nutt
534acb8281 libs/libc/dirent/lib_scandir.c: Do not build in PROTECTED or KERNEL mode builds. Add FAR to some pointers. Minor comment updates. 2019-07-31 11:16:18 -06:00
Michael Jung
ded8711261 libs/libc/dirent/: Added alphasort, scandir and DT_* defines
- Added an alphasort implementation
- Added a scandir implementation
- Added DT_* literals to include/dirent.h: Apparently those are not required by POSIX, but are part of 4.3BSD and available in glibc as well.
2019-07-31 07:53:14 -06:00
Masayuki Ishikawa
5bf674a99f Merged in masayuki2009/nuttx.nuttx/fix_build_error_for_elf (pull request #959)
libs/libc/machine/arm/armv7-m: Fix build error for elf

Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-07-30 13:08:59 +00:00
David S. Alessio
f2b96016ad libs/libc/machine/arm/armv7-m: Add Cortex M4F mach optimized fabsf and sqrtf. 2019-07-29 20:27:33 -06:00
Gregory Nutt
9f24fb5b4b sched/: Add some missing FAR. Update some comments. 2019-07-29 15:04:39 -06:00
Gregory Nutt
eef2f4599e Commit 933e9e407b broke the simulator on a 64-bit platform. 2019-07-29 14:34:29 -06:00
David Sidrane
933e9e407b libs/libc/stdio/lib_libvsprintf.c: Add support for the size_t integer qualifier 'z'. This is kind of tricky due the variety of sizeof(size_t) on different platforms. 2019-07-24 12:49:56 -06:00
Michael Jung
b9d2e516ef libs/libc/netdb: Implemented the netdb functions getnameinfo(), getservbyport(), and getservbyport_r(). 2019-06-30 15:12:34 -06:00
Eduard Niesner
056eebd9da arch/arm/src/stm32h7: Ported the QEncoder from F7 to H7. 2019-06-27 07:07:55 -06:00
Gregory Nutt
40179da030 Squashed commit of the following:
libs/libc/misc/Make.defs:  For platforms whose CPP tool does not support a variable number arguments to pre-processor macros, we may still need to build the debug functions even when CONFIG_DEBUG_FEATURES is not selected.  For example, __alert() may be needed is CONFIG_ARCH_STACKDUMP is set.

    configs/makerlisp:  Add an sdboot configuration that will load .hex files from the SD card.
2019-06-26 14:37:19 -06:00
Adam Porter
3505cce201 drivers/usbhost/usbhost_composite.c: The cfgdesc pointer was initialized after the buffer had been advanced, so it was not pointing where it should. The totallen operations at the end of the function ended up overwriting memory belonging to the first copied interface descriptor. 2019-06-22 07:27:15 -06:00
Gregory Nutt
611eb12074 configs/makerlisp: Add Smart Flash Programmer project. Updae a README. 2019-06-12 07:38:54 -06:00
Gregory Nutt
417e681cbb libs/libc/time/lib_gmtimer.c: Spurious reorganization of a loop to work around and ZDD-II internal compiler error. Might be a little bigger now, but is also probably a more structured use of C. 2019-06-10 09:50:33 -06:00
Gregory Nutt
4e98980045 Add initial support for the MakerLisp eZ80 board. Ref: https://makerlisp.com/
Squashed commit of the following:

    configs/makerlisp:  Update comments about use of serial console.

    configs/makerlisp:  Add LED support, remove vestiges of button support (the board has no user buttons).  Add support for SPI-based MMC/SD card slot.

    arch/z80/src/ez80:  Fix some link problems.

    libs/libc/syslog/lib_syslog.c:  The ZDS-II toolchain does not declare va_coy in stdarg.h.  I think that the use of va_copy in vsyslog() is no necessary.

    configs/makerlisp:  Initial configuration directories cloned from ez80f910200zco with little more than naming changes.
2019-06-04 11:12:17 -06:00
Gregory Nutt
622c272ea3 Clean up some variouis compiler problems using SDCC to compiler Z180. 2019-06-03 18:16:23 -06:00
Gregory Nutt
7ab149d8e9 Various fixes to get a clean compile with the SDCC compiler. Compile is 'almost' clean. 2019-06-03 16:53:11 -06:00
Gregory Nutt
84a57f8fa0 Fix several ZNeo compile issues. There are more. Pthreads: Fix a could of places where FAR was added when it is not appropriate. This matters to ZNeo which depends on definitions of NEAR and FAR points. 2019-06-03 13:06:58 -06:00
Gregory Nutt
25f42dd076 libs/libc/time/: Costmetic changes to make gmtime() and gmtimer() follow the coding standard more closely. 2019-06-03 11:18:17 -06:00
Gregory Nutt
2dae0ef0db mm/mm_heap/mm_sem.c: Fix error that occurs when CONFIG_CPP_HAVE_VARARGS is not defined. In that case, the arguments to the debug macro will all be evaluated even though they are not used any variables that are references must at least be defined. 2019-06-03 09:02:55 -06:00
Gregory Nutt
d375a26a6c libs/libc/stdio: Fix long long usage in all of the newer printf-related logic: The selection CONFIG_LIBC_LONG_LONG must be ignored if the architecture does not support long long types. 2019-06-03 08:45:57 -06:00
Gregory Nutt
abf6965c24 Squashed commit of the following:
libs/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    syscall/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    wireless/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    Documentation/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    include/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    drivers/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    sched/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    configs:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/xtensa:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/z80:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/x86:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/renesas and arch/risc-v:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/or1k:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/misoc:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/mips:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/avr:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/arm:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
2019-04-29 14:52:05 -06:00
Joao Matos
a095dcd6bf libs/libc/misc/lib_utsname.c: Fixed return code in uname(). 2019-04-04 10:40:39 -06:00
Joao Matos
251009de3a libs/libc/locale/lib_setlocale.c: Improved error handling in setlocale(). 2019-04-04 10:38:57 -06:00
Joao Matos
8f5a94c5e5 include/pthread.h and libs/libcpthread: Fixed pthread_attr_get/setstacksize param type to size_t. 2019-04-04 10:33:57 -06:00
Jussi Kivilinna
fd4db67b43 libs/libc/stdio/lib_libvsprintf.c: Restore support for printing NULL string as "(null)". Legacy printf supported printing "(null)" in place for NULL string:
printf("null: %s\n", NULL); => null: (null).

This commit restores this functionality for new printf library.
2019-04-04 06:31:25 -06:00
Gregory Nutt
5812bbeb04 Update ReleaseNotes in preparation for NuttX-7.29 release. 2019-03-24 17:58:51 -06:00
Gregory Nutt
0e4051a6b6 libs/libc/string/lib_strsep.c: Fix typo that I introduced in the review. 2019-03-19 12:17:04 -06:00
zhangyuan7
471a18ee4d arch/arm: Add the initial cortex-a7 archtiecture support 2019-03-19 11:51:29 -06:00
Xiang Xiao
64252a298f arch/: Unify the cache interface for all architectures 2019-03-19 10:37:13 -06:00
Xiang Xiao
2f208fdde8 arch/Kconfig: Move FPU options to a common place and unify the usage by removing ARCH_CORTEXRxF. 2019-03-19 10:26:15 -06:00