Commit Graph

347 Commits

Author SHA1 Message Date
Xiang Xiao 8a14a13819 binfmt: Rename dump_module to binfmt_dumpmodule
follow other binfmt function naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:16:06 +09:00
Alexander Lunev 4018cc186c libelf: fix "nsh: nsh_session: readline failed: 13" error
Resolves issue #3751
2021-05-21 02:12:31 -07:00
Xiang Xiao 85c1354043 binfmt/elf: Don't close filfd in the fail path
to avoid close the same handle twice because
the caller also call elf_uninit in this case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iddcbae9587d11d3b5b06e876d4a037ac0d11992e
2021-05-12 21:09:29 -07:00
Liio Chen 468e08c1b4 binnfmt:Fix return before close ELF fd
elf_init open a elf file , if both enabled
   CONFIG_NSH_BUIlTAPPS and CONFIG_NSH_FILE_APPS ,
   elf_init will read elf file in /bin directory, but
   that length is zero , elf_read failed return and NOT
   close elf fd, so this line MUST be return to errout_with_init
2021-05-07 06:42:15 -07:00
Byron Ellacott c9db653c8d symtabs: improve handling of symbol lookups
When CONFIG_SYMTAB_ORDEREDBYNAME is selected most code will use
the ordered search function. When it is not selected no code will
use the ordered search function. This change merges the two
functions and varies its behaviour based on the config setting,
such that all callers can simply call the one search function
and get the best behaviour.

An additional configuration option allows leading underscores to
be stripped from symbols being relocated in loaded objects. This
allows toolchains which prefix C symbol with underscores to make
loadable ELF objects.
2021-03-16 10:18:17 -07:00
Abdelatif Guettouche d85c432278 Few typos fixes in binfmt and libc/machine.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-03-11 10:35:40 +08:00
Gustavo Henrique Nihei 330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Gustavo Henrique Nihei 13535d8725 linkerfiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Alin Jerpelea f9fb182809 Author: Gregory Nutt: update licenses to Apache
Update files from Gregory Nutt to Apache 2.0 license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-05 12:15:56 -03:00
Alin Jerpelea 789d3751ad binfmt: libnxflat: nxstyle error fix
Fix nxstyle errors to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-05 12:15:56 -03:00
Xiang Xiao 0dc6990166 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-13 08:57:58 +01:00
Xiang Xiao 0536953ded Kernel module should prefer functions with nx/kmm prefix
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-13 08:57:58 +01:00
chao.an c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
YAMAMOTO Takashi 85f38b01c1 binfmt/libelf/libelf_dtors.c: Fix a syslog format 2020-11-27 05:18:57 -06:00
YAMAMOTO Takashi 44e61d7fe7 binfmt/libelf/libelf_ctors.c: Fix a syslog format 2020-11-27 05:18:57 -06:00
YAMAMOTO Takashi 78797dc1da binfmt/libnxflat/libnxflat_bind.c: Fix syslog formats 2020-11-25 05:11:26 -08:00
YAMAMOTO Takashi ca2cc5133d binfmt/libnxflat/libnxflat_load.c: Fix syslog formats 2020-11-25 05:11:26 -08:00
YAMAMOTO Takashi b9538bf885 binfmt/libnxflat/libnxflat_load.c: Appease nxstyle 2020-11-25 05:11:26 -08:00
Matias N d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
YAMAMOTO Takashi d068713738 binfmt/libelf/libelf_symbols.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi 148ee150f0 binfmt/libelf/libelf_bind.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi 48e3e2d390 binfmt/binfmt_dumpmodule.c: Fix syslog format errors 2020-11-20 22:22:53 -08:00
Nathan Hartman 80ce7800a9 Sources and Docs: Fix typos and nxstyle issues
Documentation/contributing/coding_style.rst:

    * Fix repeated words: ("this this").
    * Remove trailing spaces.

boards/z80/z80/z80sim/README.txt:

    * Fix repeated words: ("this this") and rewrap lines.

graphics/Kconfig,
libs/libc/math/Kconfig:

    * Fix repeated words: ("this this").

arch/arm/src/armv7-a/arm_assert.c,
arch/arm/src/armv7-r/arm_assert.c,
arch/arm/src/imxrt/imxrt_enet.c,
arch/arm/src/kinetis/kinetis_enet.c,
arch/arm/src/kinetis/kinetis_flexcan.c,
arch/arm/src/s32k1xx/s32k1xx_enet.c,
arch/arm/src/s32k1xx/s32k1xx_flexcan.c,
arch/arm/src/stm32/stm32_pwm.c,
arch/arm/src/stm32h7/stm32_pwm.c,
arch/arm/src/stm32l4/stm32l4_pwm.c,
arch/renesas/src/rx65n/rx65n_usbdev.c,
binfmt/libnxflat/libnxflat_bind.c,
drivers/pipes/pipe_common.c,
net/igmp/igmp_input.c,
net/tcp/tcp_conn.c,
sched/sched/sched_roundrobin.c:

    * Fix typo in comment ("this this").

arch/arm/src/cxd56xx/cxd56_usbdev.c,
arch/arm/src/lc823450/lc823450_usbdev.c:

    * Fix typo in comment and rewrap lines.

arch/arm/src/imxrt/imxrt_usbdev.c,
arch/arm/src/stm32/stm32_dac.c,
arch/arm/src/stm32f0l0g0/stm32_pwm.c,
arch/arm/src/stm32f7/stm32_pwm.c,
arch/arm/src/tiva/lm/lm4f_gpio.h,
fs/nxffs/nxffs_write.c,
include/nuttx/analog/pga11x.h,
include/nuttx/usb/usbdev.h,
net/mld/mld_join.c:

    * Fix typo in comment ("this this").
    * Fix nxstyle issues.
2020-10-02 04:54:52 +02:00
Xiang Xiao ae356001cf Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
SPRESENSE e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
Xiang Xiao 2b7528feae binfmt: Fix warning: unused variable ‘exidx’
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I55d3355813b8b24727e2a7f78fcd72622a1e6758
2020-07-21 00:03:47 -07:00
Xiang Xiao fbfd9d62da libelf: Parse .ARM.exidx only for ARM architecture
since other arch has the different unwind approach

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icefa0d4bc31bff967372949216d337770cd7e768
2020-07-11 10:34:22 -07:00
Xiang Xiao 14ecb8723a sched: Change tcb_s to task_tcb_s for nxtask_[un]init
since these functions can just work with task not thread

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-30 10:54:42 -06:00
chao.an b9ad4a000e binfmt/exec: allocate stack from internal
Implement of nxtask_init() support stack allocation from internal

Change-Id: I4885c5b901d90e57eb9d15d8bc1af32761584d19
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
chao.an 2fc02ec4a4 sched/task_init: change the stack pointer type to (void *)
change the stack pointer type from (uint32_t *) to (void *)

Change-Id: I90bb7d6a9cb0184c133578a1a2ae9a19c233ad30
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
Xiang Xiao a69678810d sched: Change the return type of nxtask_activate to void
to simplify the error handling logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I00fedd4d69620a7cc7b9f9e8bf4ba7f7989dc2b2
2020-06-04 22:20:45 +01:00
Xiang Xiao b932b653dd arch: Select 64bit elf base on the architecture characteristic
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I09eec5a76f255016a910cfec3b3f70cd7577525e
2020-05-31 21:38:32 -07:00
Gregory Nutt 82debdc213 Make task_init() and task_activate() internal OS functions.
-Move task_init() and task_activate() prototypes from include/sched.h to include/nuttx/sched.h.  These are internal OS functions and should not be exposed to the user.
-Remove references to task_init() and task_activate() from the User Manual.
-Rename task_init() to nxtask_init() since since it is an OS internal function
-Rename task_activate() to nxtask_activate since it is an OS internal function
2020-05-25 23:54:45 +01:00
Xiang Xiao 23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao edb0ce2d5a build: Don't need use $(DELIM) in include statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Xiang Xiao 1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Xiang Xiao 5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Gregory Nutt a4218e2144 include/nuttx/sched.h: Make naming of all internal names consistent:
1. Add internal scheduler functions should begin with nxsched_, not sched_
2. Follow the consistent naming patter of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-09 14:19:08 -03:00
Xiang Xiao 5c748cea2a sched: Don't need call get_errno after task_activate
since task_activate don't save the error code into errno

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-03 12:15:54 -06:00
Xiang Xiao 3c84278aa7 sched: task_init as internal function shouldn't modify errno
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-03 12:15:54 -06:00
Xiang Xiao 8d1a0c2761 binfmt: exec_spawn as internal function shouldn't modify errno
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-03 12:15:54 -06:00
Xiang Xiao fe5cb9529d builtin: Remove HAVE_BUILTIN_CONTEXT macro
it's enough to decide which code should be compiled with CONFIG_BUILTIN and CONFIG_FS_BINFS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Alin Jerpelea 7ddf7c6c25 binfmt: nxstyle fixes
small nxstyle fixes for binfmt to avoid CI warnings

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-22 14:07:04 -06:00
Gregory Nutt 72104c182c nxstyle fixes
Run all files modified by PR 766 through nxstyle and fix any resulting complaints.

NOTE:  Numerous "Mixed case identifier" errors in arch/arm/src/cxd56xx/cxd56_gnss.c were not fixed because this problem is of much larger scope than this file.
2020-04-11 21:19:47 +01:00
Gregory Nutt 67ec3d7926 Remove CONFIG_CAN_PASS_STRUCT
This commit resolves issue #620:

Remove CONFIG_CAN_PASS_STRUCTS #620

The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    struct mallinfo mallinfo(void);
    #else
    int      mallinfo(FAR struct mallinfo *info);
    #endif

And even leads to violation of a few POSIX interfaces like:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    int  sigqueue(int pid, int signo, union sigval value);
    #else
    int  sigqueue(int pid, int signo, FAR void *sival_ptr);
    #endif

This breaks the 1st INVIOLABLES rule:

Strict POSIX compliance
-----------------------

  o Strict conformance to the portable standard OS interface as defined at
    OpenGroup.org.
  o A deeply embedded system requires some special support.  Special
    support must be minimized.
  o The portable interface must never be compromised only for the sake of
    expediency.
  o Expediency or even improved performance are not justifications for
   violation of the strict POSIX interface

Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132

NOTE:  This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
2020-04-11 21:19:47 +01:00
YAMAMOTO Takashi 24c9fa3cd9 Kconfig: Move ELF_64BIT out of !BINFMT_DISABLE
Because it's also used by LIBC_MODLIB.
2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi bb09d564db libelf: Don't truncate 64-bit values 2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi f8077022bd Introduce CONFIG_DEFAULT_TASK_STACKSIZE
* The appropriate size of stack varies among archs.
  E.g. for 64-bit sim, 2048 is way too small, especially when the task
  happens to use host OS functionalities.
  I plan to allow an arch provide its own default.

* I plan to use this to replace hardcoded "STACKSIZE = 2048" in APPDIR.
2020-03-26 22:30:13 -05:00